feat: make company selection mandatory for partner role and add inline company creation in UserDialog
All checks were successful
Staging Build / build (push) Successful in 2m21s

This commit is contained in:
DanielS
2026-06-25 01:43:53 +02:00
parent 67a2c2a67b
commit 85df922498
2 changed files with 139 additions and 60 deletions

View File

@@ -11,7 +11,7 @@ export async function getCompanies() {
export async function createCompany(name: string) {
const admin = createAdminClient()
const { data, error } = await admin.from('companies').insert({ name }).single()
const { data, error } = await admin.from('companies').insert({ name }).select().single()
if (error) throw error
revalidatePath('/admin/companies')
return data
@@ -19,7 +19,7 @@ export async function createCompany(name: string) {
export async function updateCompany(id: string, name: string) {
const admin = createAdminClient()
const { data, error } = await admin.from('companies').update({ name }).eq('id', id).single()
const { data, error } = await admin.from('companies').update({ name }).eq('id', id).select().single()
if (error) throw error
revalidatePath('/admin/companies')
return data