Skip to content

Commit

Permalink
fix: fix UI issue on creating proxy record (#22410)
Browse files Browse the repository at this point in the history
fix UI issue on creating proxy record
  • Loading branch information
frankh authored and timgl committed May 24, 2024
1 parent 8e693da commit 9fc4c2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/scenes/settings/project/proxyLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const proxyLogic = kea<proxyLogicType>([
})
lemonToast.success('Record created')
actions.completeForm()
return response
return [...values.proxyRecords, response]
},
deleteRecord: async (id: ProxyRecord['id']) => {
void api.delete(`api/organizations/${values.currentOrganization?.id}/proxy_records/${id}`)
Expand All @@ -58,6 +58,7 @@ export const proxyLogic = kea<proxyLogicType>([
listeners(({ actions, values, cache }) => ({
collapseForm: () => actions.loadRecords(),
deleteRecordFailure: () => actions.loadRecords(),
deleteRecordSuccess: () => actions.loadRecords(),
createRecordSuccess: () => actions.loadRecords(),
loadRecordsSuccess: () => {
const shouldRefresh = values.proxyRecords.some((r) => ['waiting', 'issuing', 'deleting'].includes(r.status))
Expand Down

0 comments on commit 9fc4c2a

Please sign in to comment.