fix(dashboard): enable edit org name
This commit is contained in:
@@ -42,7 +42,6 @@ export default function EditOrganization({
|
||||
|
||||
return (
|
||||
<form
|
||||
className="opacity-50"
|
||||
onSubmit={handleSubmit((values) => {
|
||||
mutation.mutate(values);
|
||||
})}
|
||||
@@ -50,18 +49,12 @@ export default function EditOrganization({
|
||||
<Widget>
|
||||
<WidgetHead className="flex items-center justify-between">
|
||||
<span className="title">Org. details</span>
|
||||
<Button
|
||||
size="sm"
|
||||
type="submit"
|
||||
disabled
|
||||
// disabled={!formState.isDirty}
|
||||
>
|
||||
<Button size="sm" type="submit" disabled={!formState.isDirty}>
|
||||
Save
|
||||
</Button>
|
||||
</WidgetHead>
|
||||
<WidgetBody>
|
||||
<InputWithLabel
|
||||
disabled
|
||||
label="Name"
|
||||
{...register('name')}
|
||||
defaultValue={organization?.name}
|
||||
|
||||
@@ -23,7 +23,7 @@ export const organizationRouter = createTRPCRouter({
|
||||
organizationId: input.id,
|
||||
});
|
||||
|
||||
if (!access) {
|
||||
if (access?.role !== 'org:admin') {
|
||||
throw TRPCAccessError('You do not have access to this project');
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export const organizationRouter = createTRPCRouter({
|
||||
organizationId: input.organizationSlug,
|
||||
});
|
||||
|
||||
if (!access) {
|
||||
if (access?.role !== 'org:admin') {
|
||||
throw TRPCAccessError('You do not have access to this project');
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ export const organizationRouter = createTRPCRouter({
|
||||
organizationId: member.organizationId,
|
||||
});
|
||||
|
||||
if (!access) {
|
||||
if (access?.role !== 'org:admin') {
|
||||
throw TRPCAccessError('You do not have access to this project');
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ export const organizationRouter = createTRPCRouter({
|
||||
organizationId: input.organizationId,
|
||||
});
|
||||
|
||||
if (!access) {
|
||||
if (access?.role !== 'org:admin') {
|
||||
throw TRPCAccessError('You do not have access to this project');
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ export const organizationRouter = createTRPCRouter({
|
||||
organizationId: input.organizationSlug,
|
||||
});
|
||||
|
||||
if (!access) {
|
||||
if (access?.role !== 'org:admin') {
|
||||
throw TRPCAccessError('You do not have access to this project');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user