refactor: simplify app status and response shape in API
Derive status from app.active flag instead of maintenance/bugs heuristic. Remove version, minVersion, and maintenance from list/detail response as these are fetched separately via the grid overview endpoint.
This commit is contained in:
10
src/app.ts
10
src/app.ts
@@ -363,11 +363,8 @@ export function createApp() {
|
||||
return apps.map((app) => ({
|
||||
id: app.id,
|
||||
name: app.name,
|
||||
status: app.maintenance ? 'warning' : app.bugs.length > 0 ? 'error' : 'active',
|
||||
status: app.active ? 'active' : 'inactive',
|
||||
errors: app.bugs.length,
|
||||
version: app.version ?? '-',
|
||||
minVersion: app.minVersion,
|
||||
maintenance: app.maintenance,
|
||||
active: app.active,
|
||||
urlApi: app.urlApi,
|
||||
hasClientApiKey: !!app.clientApiKey,
|
||||
@@ -400,11 +397,8 @@ export function createApp() {
|
||||
return {
|
||||
id: app.id,
|
||||
name: app.name,
|
||||
status: app.maintenance ? 'warning' : app.bugs.length > 0 ? 'error' : 'active',
|
||||
status: app.active ? 'active' : 'inactive',
|
||||
errors: app.bugs.length,
|
||||
version: app.version ?? '-',
|
||||
minVersion: app.minVersion,
|
||||
maintenance: app.maintenance,
|
||||
urlApi: app.urlApi,
|
||||
totalBugs: app._count.bugs,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user