mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-22 15:36:12 +01:00
Prevent removing participants with expenses
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { GroupForm } from '@/components/group-form'
|
||||
import { getGroup, updateGroup } from '@/lib/api'
|
||||
import { getGroup, getGroupExpensesParticipants, updateGroup } from '@/lib/api'
|
||||
import { groupFormSchema } from '@/lib/schemas'
|
||||
import { Metadata } from 'next'
|
||||
import { notFound, redirect } from 'next/navigation'
|
||||
@@ -23,5 +23,12 @@ export default async function EditGroupPage({
|
||||
redirect(`/groups/${group.id}`)
|
||||
}
|
||||
|
||||
return <GroupForm group={group} onSubmit={updateGroupAction} />
|
||||
const protectedParticipantIds = await getGroupExpensesParticipants(groupId)
|
||||
return (
|
||||
<GroupForm
|
||||
group={group}
|
||||
onSubmit={updateGroupAction}
|
||||
protectedParticipantIds={protectedParticipantIds}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user