diff --git a/src/app/WardrobePage/support/ItemSupportDrawer.js b/src/app/WardrobePage/support/ItemSupportDrawer.js index eb7cab3..6c65ce2 100644 --- a/src/app/WardrobePage/support/ItemSupportDrawer.js +++ b/src/app/WardrobePage/support/ItemSupportDrawer.js @@ -71,15 +71,24 @@ function ItemSupportDrawer({ item, isOpen, onClose }) { } function SpecialColorFields({ item }) { - const { loading, error, data } = useQuery(gql` - query ItemSupportDrawer { - allColors { - id - name - isStandard + const { loading, error, data } = useQuery( + gql` + query ItemSupportDrawerSpecialColorFields($itemId: ID!) { + allColors { + id + name + isStandard + } + + item(id: $itemId) { + manualSpecialColor { + id + } + } } - } - `); + `, + { variables: { itemId: item.id } } + ); const nonStandardColors = data?.allColors?.filter((c) => !c.isStandard) || []; nonStandardColors.sort((a, b) => a.name.localeCompare(b.name)); @@ -88,8 +97,11 @@ function SpecialColorFields({ item }) { Special color