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
All checks were successful
Staging Build / build (push) Successful in 2m21s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user