From a1903d3abce1cafb7cdc48da762bfd1531ffaca1 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Wed, 4 Dec 2024 10:16:34 +0100 Subject: [PATCH] refactor --- .../components/catalog/CatalogPermissions.tsx | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/assets/src/components/catalog/CatalogPermissions.tsx b/assets/src/components/catalog/CatalogPermissions.tsx index 999e700e7..5a74aa1ae 100644 --- a/assets/src/components/catalog/CatalogPermissions.tsx +++ b/assets/src/components/catalog/CatalogPermissions.tsx @@ -79,13 +79,12 @@ export function CatalogPermissionsModal({ [writeBindings] ) - const [mutation, { loading: mutationLoading, error: mutationError }] = - useUpsertCatalogMutation({ - onCompleted: () => { - refetch?.() - onClose() - }, - }) + const [mutation, { loading, error }] = useUpsertCatalogMutation({ + onCompleted: () => { + refetch?.() + onClose() + }, + }) const allowSubmit = readBindings && writeBindings const onSubmit = useCallback( @@ -99,6 +98,7 @@ export function CatalogPermissionsModal({ attributes: { name: catalog.name, author: catalog.author ?? '', + category: catalog.category, createBindings: createBindings ?.filter(isNonNullable) .map(bindingToBindingAttributes), @@ -115,8 +115,7 @@ export function CatalogPermissionsModal({ [ allowSubmit, mutation, - catalog.name, - catalog.author, + catalog, createBindings, readBindings, writeBindings, @@ -146,7 +145,7 @@ export function CatalogPermissionsModal({