mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
(cherry picked from commit 374072908c366f41b8a09cc626faa68533e550f9)
This commit is contained in:
parent
a5ceb68296
commit
d2464fd9d6
@ -35,14 +35,14 @@ function CreateVmTemplate() {
|
||||
const { enqueueSuccess } = useGeneralApi()
|
||||
const { update, allocate } = useVmTemplateApi()
|
||||
|
||||
const onSubmit = async (template) => {
|
||||
const onSubmit = async (xmlTemplate) => {
|
||||
try {
|
||||
if (templateId === undefined) {
|
||||
await allocate(template)
|
||||
if (!templateId) {
|
||||
const newTemplateId = await allocate(xmlTemplate)
|
||||
history.push(PATH.TEMPLATE.VMS.LIST)
|
||||
enqueueSuccess(`VM Template created - #${templateId}`)
|
||||
enqueueSuccess(`VM Template created - #${newTemplateId}`)
|
||||
} else {
|
||||
await update(templateId, template)
|
||||
await update(templateId, xmlTemplate)
|
||||
history.push(PATH.TEMPLATE.VMS.LIST)
|
||||
enqueueSuccess(`VM Template updated - #${templateId} ${NAME}`)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user