Skip to content

Commit

Permalink
fix: 메인 카테고리 삭제를 취소하는 조건 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
chaeseungyun committed Nov 21, 2024
1 parent 58ee3c6 commit dd3072b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/Services/Store/components/StoreCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default function StoreCategory({ form } : { form: FormInstance }) {
? selectedCategory.filter(({ id }) => category.id !== id)
: [...selectedCategory, category];

if (!newList.map((item) => item.id).includes(mainCategoryId)) return;
if (categories.map((item) => item.id).includes(mainCategoryId)
&& !newList.map((item) => item.id).includes(mainCategoryId)) return;

form.setFieldsValue({
shop_categories: newList,
Expand Down

0 comments on commit dd3072b

Please sign in to comment.