Skip to content

Commit 599c93a

Browse files
authored
Merge pull request #201 from gnims-project/dev
HotFix 삭제 후 500error수정 #100
2 parents 8a209c0 + 4ded94a commit 599c93a

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

src/components/modal/KebabButtonModal.jsx

+26-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const KebabModal = ({ setModalOpen, id }) => {
2424

2525
const confirmDeleteHandler = () => {
2626
//DELETE 기능넣으면 됨
27-
dispatch(__deleteSchedule([id, userId, dispatch]));
27+
dispatch(__deleteSchedule({ id, userId, dispatch }));
2828
navigate("/main");
2929
};
3030

@@ -35,8 +35,12 @@ const KebabModal = ({ setModalOpen, id }) => {
3535
{deleteModalOpen ? (
3636
// <DeleteScheduleModal/>
3737
<div className="text-black pt-8 items-center w-[300px] h-[167px] text-center rounded-[16px] fixed top-[38%] z-20 bg-white ">
38-
<div className="text-[18px] font-bold flex flex-col ">해당 일정을 삭제하시겠습니까? </div>
39-
<div className="mt-[14px] text-[14px] text-[#6F6F6F]">삭제된 일정은 복구가 불가능합니다.</div>
38+
<div className="text-[18px] font-bold flex flex-col ">
39+
해당 일정을 삭제하시겠습니까?{" "}
40+
</div>
41+
<div className="mt-[14px] text-[14px] text-[#6F6F6F]">
42+
삭제된 일정은 복구가 불가능합니다.
43+
</div>
4044
<button
4145
className="bg-[#A31414] rounded-[4px] h-[40px] w-[127px] text-white mt-[18px]"
4246
onClick={confirmDeleteHandler}
@@ -54,23 +58,38 @@ const KebabModal = ({ setModalOpen, id }) => {
5458
//이하는 모두 케밥버튼눌렀을 때 수정&삭제 모달
5559
<div className=" bottom-0 w-[375px] h-[205px] rounded-t-lg bg-white fixed ">
5660
<div className="h-[25px] pt-[11px]">
57-
<img src={barIcon} alt="bar" className="w-[80px] h-[3px] m-auto" />
61+
<img
62+
src={barIcon}
63+
alt="bar"
64+
className="w-[80px] h-[3px] m-auto"
65+
/>
5866
</div>
5967
<div
6068
onClick={scheduleEditHandler}
6169
className="cursor-pointer text-[#121213] font-bold pt-[23px] h-[60px] flex row border-solid border-[rgb(226,226,226)] border-b-[1px]"
6270
>
63-
<img src={editIcon} alt="edit" className="w-[18px] h-[18px] ml-[30px] mr-[20px]" />
71+
<img
72+
src={editIcon}
73+
alt="edit"
74+
className="w-[18px] h-[18px] ml-[30px] mr-[20px]"
75+
/>
6476
수정
6577
</div>
6678
<div
6779
onClick={scheduleDeleteHandler}
6880
className="cursor-pointer text-[#A31414] font-bold pt-[23px] h-[60px] flex row border-solid border-[rgb(226,226,226)] border-b-[1px]"
6981
>
70-
<img src={deleteIcon} alt="delete" className="w-[24px] h-[24px] ml-[30px] mr-[20px] z-0" />
82+
<img
83+
src={deleteIcon}
84+
alt="delete"
85+
className="w-[24px] h-[24px] ml-[30px] mr-[20px] z-0"
86+
/>
7187
삭제
7288
</div>
73-
<div className="cursor-pointer m-auto text-center pt-[22px] h-[60px] font-bold" onClick={closeModal}>
89+
<div
90+
className="cursor-pointer m-auto text-center pt-[22px] h-[60px] font-bold"
91+
onClick={closeModal}
92+
>
7493
닫기
7594
</div>
7695
</div>

src/redux/modules/ScheduleSlice.jsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
2-
import axios from "axios";
3-
import { useDispatch } from "react-redux";
42
import { ScheduleApi } from "../../api/ScheduleApi";
53
import { instance } from "../../shared/AxiosInstance";
64

@@ -22,9 +20,9 @@ const initialState = {
2220
};
2321
export const __deleteSchedule = createAsyncThunk(
2422
"schedule/delete",
25-
async (id) => {
26-
const response = await ScheduleApi.deleteScheduleApi(id[0]);
27-
id[2](__getSchedule(id[1]));
23+
async ({ id, userId, dispatch }) => {
24+
const response = await ScheduleApi.deleteScheduleApi(id);
25+
dispatch(__getSchedule({ userId: userId, sortedBy: "event.dDay" }));
2826
return response.data;
2927
}
3028
);

0 commit comments

Comments
 (0)