feature(dashboard): add integrations and notifications

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-10-02 22:12:05 +02:00
parent d920f6951c
commit f65a633403
94 changed files with 3692 additions and 127 deletions

View File

@@ -1,6 +1,11 @@
import { z } from 'zod';
import { db, getId, getProjectsByOrganizationSlug } from '@openpanel/db';
import {
db,
getId,
getProjectByIdCached,
getProjectsByOrganizationSlug,
} from '@openpanel/db';
import { getProjectAccess } from '../access';
import { TRPCAccessError } from '../errors';
@@ -34,8 +39,7 @@ export const projectRouter = createTRPCRouter({
if (!access) {
throw TRPCAccessError('You do not have access to this project');
}
return db.project.update({
const res = await db.project.update({
where: {
id: input.id,
},
@@ -43,6 +47,8 @@ export const projectRouter = createTRPCRouter({
name: input.name,
},
});
await getProjectByIdCached.clear(input.id);
return res;
}),
create: protectedProcedure
.input(