feat: update workspace name

This commit is contained in:
Henry
2024-09-17 21:54:03 +01:00
parent a06500a949
commit 233e19276e
6 changed files with 142 additions and 7 deletions

View File

@@ -55,6 +55,22 @@ export const workspaceRouter = createTRPCRouter({
code: "INTERNAL_SERVER_ERROR",
});
return result;
}),
update: protectedProcedure
.input(
z.object({
workspacePublicId: z.string().min(12),
name: z.string().min(3).max(24),
}),
)
.mutation(async ({ ctx, input }) => {
const result = await workspaceRepo.update(
ctx.db,
input.workspacePublicId,
input.name,
);
return result;
}),
delete: protectedProcedure