Skip to content

Commit 2845cce

Browse files
committed
fix list apps
1 parent 5dc9dfe commit 2845cce

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

backend/windmill-api/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4825,6 +4825,9 @@ components:
48254825
type: boolean
48264826
starred:
48274827
type: boolean
4828+
edited_at:
4829+
type: string
4830+
format: date-time
48284831
execution_mode:
48294832
type: string
48304833
enum: [viewer, publisher, anonymous]

backend/windmill-api/src/apps.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ async fn list_apps(
132132
"summary",
133133
"versions[array_upper(versions, 1)] as version",
134134
"policy->>'execution_mode' as execution_mode",
135+
"app_version.created_at as edited_at",
135136
"extra_perms",
136137
"favorite.path IS NOT NULL as starred",
137138
])
@@ -141,9 +142,14 @@ async fn list_apps(
141142
"favorite.favorite_kind = 'app' AND favorite.workspace_id = app.workspace_id AND favorite.path = app.path AND favorite.usr = ?"
142143
.bind(&authed.username),
143144
)
145+
.left()
146+
.join("app_version")
147+
.on(
148+
"app_version.id = versions[array_upper(versions, 1)]"
149+
)
144150
.order_desc("favorite.path IS NOT NULL")
145-
.order_by("path", true)
146-
.and_where("workspace_id = ?".bind(&w_id))
151+
.order_by("app_version.created_at", true)
152+
.and_where("app.workspace_id = ? OR app.workspace_id = 'starter'".bind(&w_id))
147153
.offset(offset)
148154
.limit(per_page)
149155
.clone();

0 commit comments

Comments
 (0)