fix: resolve TypeScript compilation errors from service extraction

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-03-23 09:11:04 +01:00
parent 28eb58946f
commit c0b8a94210
8 changed files with 34 additions and 29 deletions

View File

@@ -46,7 +46,7 @@ export default async function usersRoutes(fastify: FastifyInstance): Promise<voi
is_active: body.is_active,
});
if ('error' in result) return error(reply, result.error, result.status);
if ('error' in result) return error(reply, result.error!, result.status!);
await logAudit({
request,
@@ -67,8 +67,12 @@ export default async function usersRoutes(fastify: FastifyInstance): Promise<voi
const parsed = parseBody(UpdateUserSchema, request.body);
if ('error' in parsed) return error(reply, parsed.error, 400);
const result = await updateUser(id, parsed.data);
if ('error' in result) return error(reply, result.error, result.status);
const userData = {
...parsed.data,
role_id: parsed.data.role_id != null ? Number(parsed.data.role_id) : parsed.data.role_id as number | null | undefined,
};
const result = await updateUser(id, userData);
if ('error' in result) return error(reply, result.error!, result.status!);
await logAudit({
request,
@@ -88,7 +92,7 @@ export default async function usersRoutes(fastify: FastifyInstance): Promise<voi
if (id === null) return;
const result = await deleteUser(id, request.authData?.userId);
if ('error' in result) return error(reply, result.error, result.status);
if ('error' in result) return error(reply, result.error!, result.status!);
await logAudit({
request,