Skip to content

Commit fbee11d

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(byok): refresh org key state after mutations
1 parent b1772b1 commit fbee11d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/sim/hooks/queries/byok-keys.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export function useUpsertOrganizationBYOKKey() {
173173
logger.info(`Saved BYOK key for ${body.providerId} in organization ${organizationId}`)
174174
return data
175175
},
176-
onSuccess: async (_data, variables) => {
176+
onSettled: async (_data, _error, variables) => {
177177
await Promise.all([
178178
queryClient.invalidateQueries({
179179
queryKey: byokKeysKeys.organizationList(variables.organizationId),
@@ -202,7 +202,7 @@ export function useDeleteOrganizationBYOKKey() {
202202
logger.info(`Deleted BYOK key for ${body.providerId} from organization ${organizationId}`)
203203
return data
204204
},
205-
onSuccess: async (_data, variables) => {
205+
onSettled: async (_data, _error, variables) => {
206206
await Promise.all([
207207
queryClient.invalidateQueries({
208208
queryKey: byokKeysKeys.organizationList(variables.organizationId),

0 commit comments

Comments
 (0)