Skip to content

Commit 7776c8b

Browse files
Matin Gohar FarMatin Gohar Far
authored andcommitted
fixed issue: undefined status
1 parent adb625e commit 7776c8b

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/api/votings.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ export const VotingAPI = {
2929

3030
changeVotingStatus: async (board: string, voting: string, status?: VotingStatus) => {
3131
try {
32-
const resolvedStatus: VotingStatus = typeof status === "undefined" || status === null ? "CLOSED" : status;
33-
3432
const options: RequestInit = {
3533
method: "PUT",
3634
credentials: "include",
37-
body: JSON.stringify({ status: resolvedStatus }),
35+
body: JSON.stringify({ status: status }),
3836
headers: { "Content-Type": "application/json" },
3937
};
4038

src/store/features/votings/thunks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const closeVoting = createAsyncThunk<void, string, { state: ApplicationSt
1818
const boardId = getState().board.data!.id;
1919

2020
await retryable(
21-
() => API.changeVotingStatus(boardId, payload),
21+
() => API.changeVotingStatus(boardId, payload, "CLOSED"),
2222
dispatch,
2323
() => closeVoting(payload),
2424
"closeVoting"

0 commit comments

Comments
 (0)