diff --git a/src/app/(protected)/vendors/preferences.tsx b/src/app/(protected)/vendors/preferences.tsx index 8dd1b6da..ee6e984b 100644 --- a/src/app/(protected)/vendors/preferences.tsx +++ b/src/app/(protected)/vendors/preferences.tsx @@ -60,6 +60,9 @@ export default function VendorPreferencesPage() { locationId, draft.map((item, sortOrder) => ({ vendorId: item.vendorId, trade: item.trade, sortOrder })), ), + onMutate: async () => { + await queryClient.cancelQueries({ queryKey }); + }, onSuccess: (savedPreferences) => { queryClient.setQueryData(queryKey, savedPreferences); setDraft(savedPreferences);