1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-06 12:58:18 +03:00

M #~: lint fix (#2382)

This commit is contained in:
Jorge Miguel Lobo Escalona 2022-11-25 12:43:01 +01:00 committed by GitHub
parent 384c4e5ad4
commit 4b3d4697a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -214,13 +214,15 @@ export const USER_INPUTS_SCHEMA = object({
.afterSubmit((userInputs, { context }) => {
const capacityInputs = userInputsToArray(context?.general?.MODIFICATION, {
filterCapacityInputs: false,
}).map(({ name, ...userInput }) => ({
name,
...userInput,
// set default value from MEMORY, CPU and VCPU fields
default: context.general?.[name],
...(['MEMORY', 'CPU'].includes(name) && { mandatory: true }),
})).filter((capacityInput) => capacityInput.type)
})
.map(({ name, ...userInput }) => ({
name,
...userInput,
// set default value from MEMORY, CPU and VCPU fields
default: context.general?.[name],
...(['MEMORY', 'CPU'].includes(name) && { mandatory: true }),
}))
.filter((capacityInput) => capacityInput.type)
return userInputsToObject([...capacityInputs, ...userInputs])
}),