fix: use default value got undefined value in payload (#772)

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2026-03-25 17:08:32 +08:00 committed by GitHub
parent 8083a41df0
commit ad3decf71f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,8 +45,8 @@ export default {
const cpu = { ...this.resources?.cpu }; const cpu = { ...this.resources?.cpu };
if (cpu.v1 !== null) cpu.v1 = String(cpu.v1); if (cpu.v1 !== null && cpu.v1 !== undefined) cpu.v1 = String(cpu.v1);
if (cpu.v2 !== null) cpu.v2 = String(cpu.v2); if (cpu.v2 !== null && cpu.v2 !== undefined) cpu.v2 = String(cpu.v2);
this.value.value = JSON.stringify({ ...this.resources, cpu }); this.value.value = JSON.stringify({ ...this.resources, cpu });
}, },