From a73dcb1e898c20eec774795f2c25d52a3b0034b9 Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Tue, 5 May 2026 12:43:36 +0800 Subject: [PATCH] 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. --- src/app.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/app.ts b/src/app.ts index 0d69b29..91e2f03 100644 --- a/src/app.ts +++ b/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, }