simplify some logic

This commit is contained in:
Alex Petric
2025-02-07 13:31:47 -05:00
parent 1b9c33a0fb
commit 5c10fcda73
2 changed files with 24 additions and 27 deletions
+9 -3
View File
@@ -1380,9 +1380,15 @@ async fn list_workspaces_as_super_admin(
let mut tx = user_db.begin(&authed).await?;
let workspaces = sqlx::query_as!(
Workspace,
"SELECT workspace.id, workspace.name, workspace.owner, workspace.deleted, workspace.premium, workspace_settings.color
FROM workspace
LEFT JOIN workspace_settings ON workspace.id = workspace_settings.workspace_id
"SELECT
workspace.id AS \"id!\",
workspace.name AS \"name!\",
workspace.owner AS \"owner!\",
workspace.deleted AS \"deleted!\",
workspace.premium AS \"premium!\",
workspace_settings.color AS \"color!\"
FROM workspace
LEFT JOIN workspace_settings ON workspace.id = workspace_settings.workspace_id
LIMIT $1 OFFSET $2",
per_page as i32,
offset as i32