mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-04 20:06:11 +01:00
* Use tRPC in group edition + group layout * Use tRPC in group modals * Use tRPC in group stats * Use tRPC in group activity
17 lines
510 B
TypeScript
17 lines
510 B
TypeScript
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)
|
|
})
|