mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 22:07:16 +08:00
fix: 一些小问题
This commit is contained in:
@@ -200,6 +200,10 @@ func (r *PostgreSQLController) DatabaseList(ctx http.Context) http.Response {
|
||||
}
|
||||
pagedDatabases := databases[startIndex:endIndex]
|
||||
|
||||
if pagedDatabases == nil {
|
||||
pagedDatabases = []database{}
|
||||
}
|
||||
|
||||
return controllers.Success(ctx, http.Json{
|
||||
"total": len(databases),
|
||||
"items": pagedDatabases,
|
||||
@@ -441,6 +445,10 @@ func (r *PostgreSQLController) RoleList(ctx http.Context) http.Response {
|
||||
}
|
||||
pagedRoles := roles[startIndex:endIndex]
|
||||
|
||||
if pagedRoles == nil {
|
||||
pagedRoles = []role{}
|
||||
}
|
||||
|
||||
return controllers.Success(ctx, http.Json{
|
||||
"total": len(roles),
|
||||
"items": pagedRoles,
|
||||
|
||||
Reference in New Issue
Block a user