1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

F #5637: Fix notification after create template (#1695)

(cherry picked from commit 374072908c366f41b8a09cc626faa68533e550f9)
This commit is contained in:
Sergio Betanzos 2022-01-11 19:02:16 +01:00 committed by Tino Vazquez
parent a5ceb68296
commit d2464fd9d6
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -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}`)
}