Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Refresh the staff list after a profile save
Damian Legawiecada20eed7b46
diff --git a/packages/admin-sdk/src/admin-client.ts b/packages/admin-sdk/src/admin-client.tsindex 9095354142..afb183d5fa 100644--- a/packages/admin-sdk/src/admin-client.ts+++ b/packages/admin-sdk/src/admin-client.ts@@ -78,14 +78,12 @@ export interface PermissionRule {}export interface MeResponse {- user: {- id: string- email: string- first_name: string | null- last_name: string | null- selected_locale: string | null- avatar_url: string | null- }+ /**+ * The signed-in admin, serialized exactly like every other admin user — so a+ * profile save can be merged straight into the auth context without dropping+ * the fields the top bar reads (`full_name`, `avatar_url`).+ */+ user: AdminUserpermissions: PermissionRule[]/*** The flat expanded catalog permission keys the user holds on the currentdiff --git a/packages/dashboard/src/hooks/use-profile.ts b/packages/dashboard/src/hooks/use-profile.tsindex 368d66a7ae..fcbd926588 100644--- a/packages/dashboard/src/hooks/use-profile.ts+++ b/packages/dashboard/src/hooks/use-profile.ts@@ -20,7 +20,9 @@ export function useUpdateProfile() {return useResourceMutation<MeResponse, Error, MeUpdateParams>({mutationFn: (params) => adminClient.me.update(params),- invalidate: [['profile']],+ // The signed-in admin is also a row on the staff page, so their own name+ // and avatar there go stale on a self-edit unless that list is refetched.+ invalidate: [['profile'], ['staff']],successMessage: false, // the dialog toasts success itselferrorMessage: false, // the dialog maps 422s inline via mapSpreeErrorsToForm// Write the response into the cache instead of leaning on the invalidation