mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-06 12:36:11 +01:00
Use tRPC for group create form (#250)
This commit is contained in:
committed by
GitHub
parent
210c12b7ef
commit
2281316d58
@@ -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 (
|
||||
|
||||
@@ -40,10 +40,10 @@ export default function GroupInformation({ groupId }: { groupId: string }) {
|
||||
<Skeleton className="h-3 w-3/4" />
|
||||
<Skeleton className="h-3 w-1/2" />
|
||||
</div>
|
||||
) : data.group.information ? (
|
||||
<p className="text-foreground">{data.group.information}</p>
|
||||
) : (
|
||||
data.group.information || (
|
||||
<p className="text-muted-foreground text-sm">{t('empty')}</p>
|
||||
)
|
||||
<p className="text-muted-foreground text-sm">{t('empty')}</p>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user