requestMapper: Fix enabled services with firstboot
Previously used `.push()` method was limited by non-writable length of the enabled services array, ending up in the following error: ``` Uncaught (in promise) TypeError: can't define array index property past the end of an array with non-writable length ``` This fixes the problem by updating the array via spread operator. Before: when creating an image with Oscap profile with enabled serviced and adding a firstboot script, the Create blueprint button at the Review step threw an error on click. After fix: it's possible to create an image with Oscap profile that includes enabled services and a firstboot script.
This commit is contained in:
parent
484d475bfe
commit
e051aa3f7f
1 changed files with 2 additions and 2 deletions
|
|
@ -472,12 +472,12 @@ const getServices = (state: RootState): Services | undefined => {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
const enabledSvcs = services.enabled || [];
|
||||
let enabledSvcs = services.enabled || [];
|
||||
const includeFBSvc: boolean =
|
||||
!!selectFirstBootScript(state) &&
|
||||
!services.enabled?.includes(FIRST_BOOT_SERVICE);
|
||||
if (includeFBSvc) {
|
||||
enabledSvcs.push(FIRST_BOOT_SERVICE);
|
||||
enabledSvcs = [...enabledSvcs, FIRST_BOOT_SERVICE];
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue