Skip to content

Commit

Permalink
remove from scope
Browse files Browse the repository at this point in the history
  • Loading branch information
sijumoncy committed Aug 13, 2024
1 parent f6c04f7 commit 539c2cc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function ScopeManagement({ metadata }) {
};

const handleSelectBook = (e, book) => {
console.log('clicked book : ', book);
setCurrentScope((prev) => ({ ...prev, [book.key.toUpperCase()]: [] }));
onChangeBook(book.key, book.key);
};
Expand All @@ -80,6 +79,10 @@ function ScopeManagement({ metadata }) {
const handleRemoveScope = (e, book) => {
e.stopPropagation();
console.log('clicked remove : ', book);
const bukId = book.key.toUpperCase();
const newScopeObj = { ...currentScope };
delete newScopeObj[bukId];
setCurrentScope(newScopeObj);
};

// set current scope from meta
Expand Down

0 comments on commit 539c2cc

Please sign in to comment.