mirror of
https://github.com/OpenNebula/one.git
synced 2026-12-06 07:04:45 +09:00
1 parent
52193ac74e
commit
fd9d87a450
2 files changed
+9
-3
No files matched your search
@@ -166,7 +166,7 @@ export default function useOpennebula () {
|
||||
const deleteProvision = useCallback(
|
||||
({ id }) =>
|
||||
serviceProvision
|
||||
.deleteProvider({ id })
|
||||
.deleteProvision({ id })
|
||||
.then(() => dispatch(enqueueSuccess(`Provision deleted - ID: ${id}`)))
|
||||
.catch(err => dispatch(enqueueError(err ?? 'Error DELETE provision')))
|
||||
, [dispatch, provisions]
|
||||
|
||||
@@ -54,7 +54,10 @@ export const createProvision = ({ data = {} }) =>
|
||||
method: POST,
|
||||
error: err => err?.message
|
||||
}).then(res => {
|
||||
if (!res?.id || res?.id !== httpCodes.ok.id) throw res
|
||||
if (!res?.id || res?.id !== httpCodes.ok.id) {
|
||||
if (res?.id === httpCodes.accepted.id) return res
|
||||
throw res
|
||||
}
|
||||
|
||||
return res?.data ?? {}
|
||||
})
|
||||
@@ -64,7 +67,10 @@ export const deleteProvision = ({ id }) =>
|
||||
method: DELETE,
|
||||
error: err => err?.message
|
||||
}).then(res => {
|
||||
if (!res?.id || res?.id !== httpCodes.ok.id) throw res
|
||||
if (!res?.id || res?.id !== httpCodes.ok.id) {
|
||||
if (res?.id === httpCodes.accepted.id) return res
|
||||
throw res
|
||||
}
|
||||
|
||||
return res?.data ?? {}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user