fix(api): prevent NaN act version during mobile create
Android CI / RC / Android · lint, tests, debug APK, release compile (push) Successful in 3m19s
DH V2 CI / API · typecheck, tests, build (push) Successful in 32s
DH V2 CI / WEB · typecheck, build (push) Successful in 19s
Production dependency audit / API · production dependencies (push) Successful in 8s
Production dependency audit / WEB · production dependencies (push) Successful in 8s
DH V2 CI / Docker / scripts contract (push) Successful in 1m5s

This commit is contained in:
2026-09-14 14:06:26 -03:00
parent 23880521d9
commit 103ecf2fae
6 changed files with 21 additions and 9 deletions
@@ -728,10 +728,13 @@ export class InspectionActsService {
principal: AuthPrincipal,
): Promise<number> {
const [row] = (await manager.query(`
UPDATE inspection_acts
SET current_version = current_version + 1
WHERE id = $1
RETURNING current_version AS "versionNumber"
WITH updated AS (
UPDATE inspection_acts
SET current_version = current_version + 1
WHERE id = $1
RETURNING current_version
)
SELECT current_version AS "versionNumber" FROM updated
`, [act.id])) as Array<{ versionNumber: number }>;
const versionNumber = Number(row.versionNumber);
act.currentVersion = versionNumber;
+1 -1
View File
@@ -1,2 +1,2 @@
export const API_VERSION = '0.29.0-2';
export const API_VERSION = '0.29.0-3';
export const API_PHASE = 'F6.1';