fluent requires weight to be a number, on the round trip back cast 2 int

rancher/rancher#31184
This commit is contained in:
Westly Wright 2021-02-10 17:02:03 -07:00
parent 1eafa94e55
commit b949387d8c
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
1 changed files with 7 additions and 1 deletions

View File

@ -611,13 +611,19 @@ export default Component.extend(NewOrEdit, Parse, {
endpoint = `${ get(attrs, 'host') }`
}
let castWeight = parseInt(get(attrs, 'weight'), 10);
if (Number.isNaN(castWeight)) {
castWeight = 100;
}
return {
endpoint,
sharedKey: get(attrs, 'shared_key'),
username: get(attrs, 'username'),
password: get(attrs, 'password'),
hostname: get(attrs, 'name'),
weight: get(attrs, 'weight'),
weight: castWeight,
standby: get(attrs, 'standby'),
}
})