Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
suejung-sentry committed Jan 2, 2025
1 parent 8fb2df0 commit cf75c31
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/services/orgUploadToken/useRegenerateOrgUploadToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,24 @@ export function useRegenerateOrgUploadToken({
query,
variables: { input: { owner } },
mutationPath: 'RegenerateOrgUploadToken',
}).then(({ data }) => {
const parsedRes = ResponseSchema.safeParse(data)
if (!parsedRes.success) {
return rejectNetworkError({
status: 404,
data: {},
dev: 'useRegenerateOrgUploadToken - 404 schema parsing failed',
error: parsedRes.error,
})
}

return parsedRes.data.regenerateOrgUploadToken
})
},
useErrorBoundary: true,
onSuccess: ({ data }) => {
const parsedRes = ResponseSchema.safeParse(data)
if (!parsedRes.success) {
return rejectNetworkError({
status: 404,
data: {},
dev: 'useRegenerateOrgUploadToken - 404 schema parsing failed',
error: parsedRes.error,
})
}

onSuccess(parsedRes.data.regenerateOrgUploadToken)
},
onSettled: () => {
queryClient.invalidateQueries(['DetailOwner'])
onSuccess: (res) => {
onSuccess(res)
queryClient.invalidateQueries(['DetailOwner', 'GetOrgUploadToken'])
},
retry: false,
})
}

0 comments on commit cf75c31

Please sign in to comment.