V2Wizard: Update removePackage reducer
This updates the `removePackage` reducer so it takes only a name of a package as an argument instead of the entire package object.
This commit is contained in:
parent
1dd909adb9
commit
d219a233d9
2 changed files with 3 additions and 3 deletions
|
|
@ -247,7 +247,7 @@ const Packages = () => {
|
|||
if (isSelecting) {
|
||||
dispatch(addPackage(pkg));
|
||||
} else {
|
||||
dispatch(removePackage(pkg));
|
||||
dispatch(removePackage(pkg.name));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -455,10 +455,10 @@ export const wizardSlice = createSlice({
|
|||
},
|
||||
removePackage: (
|
||||
state,
|
||||
action: PayloadAction<IBPackageWithRepositoryInfo>
|
||||
action: PayloadAction<IBPackageWithRepositoryInfo['name']>
|
||||
) => {
|
||||
state.packages.splice(
|
||||
state.packages.findIndex((pkg) => pkg.name === action.payload.name),
|
||||
state.packages.findIndex((pkg) => pkg.name === action.payload),
|
||||
1
|
||||
);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue