chore(format): Prettier auf project.ts anwenden
Alt-Bestand nie formatiert — isolierter Format-Lauf vor der Audit-Verdrahtung. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
9bae1702aa
commit
6e7f639013
1 file changed
+15
-4
@@ -1,7 +1,15 @@
|
|||||||
import { TRPCError } from '@trpc/server';
|
import { TRPCError } from '@trpc/server';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { and, eq, desc } from 'drizzle-orm';
|
import { and, eq, desc } from 'drizzle-orm';
|
||||||
import { project, milestone, area, user, projectStatus, phaseGate, type Project } from '@cockpit/db';
|
import {
|
||||||
|
project,
|
||||||
|
milestone,
|
||||||
|
area,
|
||||||
|
user,
|
||||||
|
projectStatus,
|
||||||
|
phaseGate,
|
||||||
|
type Project,
|
||||||
|
} from '@cockpit/db';
|
||||||
import { ProjectSchemas } from '@cockpit/shared';
|
import { ProjectSchemas } from '@cockpit/shared';
|
||||||
import { router, protectedProcedure } from '../trpc.js';
|
import { router, protectedProcedure } from '../trpc.js';
|
||||||
|
|
||||||
@@ -258,7 +266,8 @@ export const projectRouter = router({
|
|||||||
const existing = (
|
const existing = (
|
||||||
await ctx.db.select().from(project).where(eq(project.id, projectId)).limit(1)
|
await ctx.db.select().from(project).where(eq(project.id, projectId)).limit(1)
|
||||||
)[0];
|
)[0];
|
||||||
if (!existing) throw new TRPCError({ code: 'NOT_FOUND', message: 'Projekt nicht gefunden.' });
|
if (!existing)
|
||||||
|
throw new TRPCError({ code: 'NOT_FOUND', message: 'Projekt nicht gefunden.' });
|
||||||
return existing;
|
return existing;
|
||||||
}
|
}
|
||||||
const [updated] = await ctx.db
|
const [updated] = await ctx.db
|
||||||
@@ -312,7 +321,8 @@ export const projectRouter = router({
|
|||||||
const existing = (
|
const existing = (
|
||||||
await ctx.db.select().from(milestone).where(eq(milestone.id, milestoneId)).limit(1)
|
await ctx.db.select().from(milestone).where(eq(milestone.id, milestoneId)).limit(1)
|
||||||
)[0];
|
)[0];
|
||||||
if (!existing) throw new TRPCError({ code: 'NOT_FOUND', message: 'Meilenstein nicht gefunden.' });
|
if (!existing)
|
||||||
|
throw new TRPCError({ code: 'NOT_FOUND', message: 'Meilenstein nicht gefunden.' });
|
||||||
return existing;
|
return existing;
|
||||||
}
|
}
|
||||||
const [updated] = await ctx.db
|
const [updated] = await ctx.db
|
||||||
@@ -320,7 +330,8 @@ export const projectRouter = router({
|
|||||||
.set(patch)
|
.set(patch)
|
||||||
.where(eq(milestone.id, milestoneId))
|
.where(eq(milestone.id, milestoneId))
|
||||||
.returning();
|
.returning();
|
||||||
if (!updated) throw new TRPCError({ code: 'NOT_FOUND', message: 'Meilenstein nicht gefunden.' });
|
if (!updated)
|
||||||
|
throw new TRPCError({ code: 'NOT_FOUND', message: 'Meilenstein nicht gefunden.' });
|
||||||
return updated;
|
return updated;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user