Use tRPC in other group pages (#249)

* Use tRPC in group edition + group layout

* Use tRPC in group modals

* Use tRPC in group stats

* Use tRPC in group activity
This commit is contained in:
Sebastien Castiel
2024-10-19 21:29:53 -04:00
committed by GitHub
parent 66e15e419e
commit 210c12b7ef
35 changed files with 709 additions and 498 deletions

View File

@@ -0,0 +1,16 @@
import { updateGroup } from '@/lib/api'
import { groupFormSchema } from '@/lib/schemas'
import { baseProcedure } from '@/trpc/init'
import { z } from 'zod'
export const updateGroupProcedure = baseProcedure
.input(
z.object({
groupId: z.string().min(1),
groupFormValues: groupFormSchema,
participantId: z.string().optional(),
}),
)
.mutation(async ({ input: { groupId, groupFormValues, participantId } }) => {
await updateGroup(groupId, groupFormValues, participantId)
})