Use tRPC for group create form (#250)

This commit is contained in:
Sebastien Castiel
2024-10-19 21:48:17 -04:00
committed by GitHub
parent 210c12b7ef
commit 2281316d58
6 changed files with 49 additions and 23 deletions

View File

@@ -5,16 +5,9 @@ import { trpc } from '@/trpc/client'
export const EditGroup = ({ groupId }: { groupId: string }) => {
const { data, isLoading } = trpc.groups.get.useQuery({ groupId })
const { mutateAsync, isPending } = trpc.groups.update.useMutation()
const { mutateAsync } = trpc.groups.update.useMutation()
const utils = trpc.useUtils()
// async function updateGroupAction(values: unknown, participantId?: string) {
// 'use server'
// const groupFormValues = groupFormSchema.parse(values)
// const group = await updateGroup(groupId, groupFormValues, participantId)
// redirect(`/groups/${group.id}`)
// }
if (isLoading) return <></>
return (