feat: integrate NAS file operations with project CRUD
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,9 @@ export default async function projectsRoutes(fastify: FastifyInstance): Promise<
|
||||
const id = parseId(request.params.id, reply);
|
||||
if (id === null) return;
|
||||
|
||||
const result = await deleteProject(id);
|
||||
const body = request.body as Record<string, unknown>;
|
||||
const deleteFiles = !!body?.delete_files;
|
||||
const result = await deleteProject(id, deleteFiles);
|
||||
if (result && 'error' in result) {
|
||||
if (result.error === 'not_found') return error(reply, 'Projekt nenalezen', 404);
|
||||
if (result.error === 'has_order') return error(reply, 'Nelze smazat projekt propojený s objednávkou. Nejdříve smažte objednávku.', 400);
|
||||
|
||||
Reference in New Issue
Block a user