Skip to content

Commit

Permalink
fix: fix bugs after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
louisewang1 committed Jan 18, 2022
1 parent d9c5685 commit 5f406a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cypress/support/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,10 @@ export const mockDeleteItemCategory = (shouldThrowError) => {
{
method: DEFAULT_DELETE.method,
url: new RegExp(
`${API_HOST}/${buildDeleteItemCategoryRoute(ID_FORMAT)}$`,
`${API_HOST}/${buildDeleteItemCategoryRoute({
itemId: ID_FORMAT,
itemCategoryId: ID_FORMAT,
})}$`,
),
},
({ reply, body }) => {
Expand Down
8 changes: 6 additions & 2 deletions src/components/item/sharing/CategorySelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { hooks, useMutation } from '../../../config/queryClient';
import {
SHARE_ITEM_CATEGORY_LEVEL,
SHARE_ITEM_CATEGORY_DISCIPLINE,
SHARE_ITEM_CATEGORY_LEVEL_TITLE_ID,
} from '../../../config/selectors';
import { CurrentUserContext } from '../../context/CurrentUserContext';
import ErrorAlert from '../../common/ErrorAlert';
Expand Down Expand Up @@ -118,9 +119,10 @@ const CategorySelection = ({ item, edit }) => {
const deletedEntry = itemCategories.find(
(entry) => entry.categoryId === result[0].id,
);
console.log(deletedEntry);
deleteItemCategory({
itemId,
entryId: deletedEntry.id,
itemCategoryId: deletedEntry.id,
});
}
};
Expand All @@ -130,7 +132,9 @@ const CategorySelection = ({ item, edit }) => {
<Typography variant="h6" className={classes.selection}>
{t('Category')}
</Typography>
<Typography variant="body1">{t('Level')}</Typography>
<Typography variant="body1" id={SHARE_ITEM_CATEGORY_LEVEL_TITLE_ID}>
{t('Level')}
</Typography>
<Autocomplete
disabled={!edit || !levelList}
multiple
Expand Down

0 comments on commit 5f406a0

Please sign in to comment.