Skip to content

Commit 03d3b23

Browse files
committed
chore: Enable slug editing for superusers
1 parent 99252a5 commit 03d3b23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/create/[id]/createBlueprintSteps/PatternDetails.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const PatternDetails = ({
3535
const validationErrors = useCreateBlueprintStore((state) => state.validationErrors);
3636
const [isFileUploading, setIsFileUploading] = useState(false);
3737

38+
const { isAdmin } = useAuthStore();
3839
const { setField } = store;
3940

4041
const [isCheckExistingBlueprintLoading, setIsCheckExistingBlueprintLoading] = useState(false);
@@ -87,7 +88,7 @@ const PatternDetails = ({
8788
error={!!validationErrors.title || store.title?.includes(' ')}
8889
errorMessage={validationErrors.title || (store.title?.includes(' ') ? 'Spaces are not allowed in the pattern name' : '')}
8990
/>
90-
<Input title="Slug" disabled value={store.slug} loading={isCheckExistingBlueprintLoading} />
91+
<Input title="Slug" disabled={!isAdmin} value={store.slug} onChange={(e) => setField('slug', e.target.value)} />
9192
{/* TODO: Add check for email body max length */}
9293
{emlContent && id !== 'new' ? null : (
9394
<DragAndDropFile

0 commit comments

Comments
 (0)