fix(dashboard): enable edit org name

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-09-20 15:14:34 +02:00
parent 0959ede055
commit febf0df475
2 changed files with 6 additions and 13 deletions

View File

@@ -42,7 +42,6 @@ export default function EditOrganization({
return ( return (
<form <form
className="opacity-50"
onSubmit={handleSubmit((values) => { onSubmit={handleSubmit((values) => {
mutation.mutate(values); mutation.mutate(values);
})} })}
@@ -50,18 +49,12 @@ export default function EditOrganization({
<Widget> <Widget>
<WidgetHead className="flex items-center justify-between"> <WidgetHead className="flex items-center justify-between">
<span className="title">Org. details</span> <span className="title">Org. details</span>
<Button <Button size="sm" type="submit" disabled={!formState.isDirty}>
size="sm"
type="submit"
disabled
// disabled={!formState.isDirty}
>
Save Save
</Button> </Button>
</WidgetHead> </WidgetHead>
<WidgetBody> <WidgetBody>
<InputWithLabel <InputWithLabel
disabled
label="Name" label="Name"
{...register('name')} {...register('name')}
defaultValue={organization?.name} defaultValue={organization?.name}

View File

@@ -23,7 +23,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: input.id, organizationId: input.id,
}); });
if (!access) { if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project'); throw TRPCAccessError('You do not have access to this project');
} }
@@ -45,7 +45,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: input.organizationSlug, organizationId: input.organizationSlug,
}); });
if (!access) { if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project'); throw TRPCAccessError('You do not have access to this project');
} }
@@ -100,7 +100,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: member.organizationId, organizationId: member.organizationId,
}); });
if (!access) { if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project'); throw TRPCAccessError('You do not have access to this project');
} }
@@ -142,7 +142,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: input.organizationId, organizationId: input.organizationId,
}); });
if (!access) { if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project'); throw TRPCAccessError('You do not have access to this project');
} }
@@ -176,7 +176,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: input.organizationSlug, organizationId: input.organizationSlug,
}); });
if (!access) { if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project'); throw TRPCAccessError('You do not have access to this project');
} }