move sdk packages to its own folder and rename api & dashboard

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-11 13:15:44 +01:00
parent 1ca95442b9
commit 6d4f9010d4
318 changed files with 350 additions and 351 deletions

View File

@@ -0,0 +1,29 @@
import { createTRPCRouter, protectedProcedure } from '@/server/api/trpc';
import { z } from 'zod';
import { db } from '@mixan/db';
export const eventRouter = createTRPCRouter({
updateEventMeta: protectedProcedure
.input(
z.object({
projectId: z.string(),
name: z.string(),
icon: z.string().optional(),
color: z.string().optional(),
conversion: z.boolean().optional(),
})
)
.mutation(({ input: { projectId, name, icon, color, conversion } }) => {
return db.eventMeta.upsert({
where: {
name_project_id: {
name,
project_id: projectId,
},
},
create: { project_id: projectId, name, icon, color, conversion },
update: { icon, color, conversion },
});
}),
});