Skip to content

Commit

Permalink
fix: wrong api method
Browse files Browse the repository at this point in the history
  • Loading branch information
timepresent95 committed Aug 20, 2024
1 parent 36bc101 commit 4567aa8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/my.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ type ParamPatchMy = { userId: string };

async function patchMy(param: ParamPatchMy) {
const apiUrl = createUrl(myApis.patchMy, { param });
return await kyInstance.patch(apiUrl).json<ResponseGetMy>();
return await kyInstance.patch(apiUrl).json();
}

type ParamWithdraw = { userId: string };

async function withdraw(param: ParamWithdraw) {
const apiUrl = createUrl(myApis.withdraw, { param });
return await kyInstance.delete(apiUrl).json<ResponseGetMy>();
return await kyInstance.patch(apiUrl).json();
}

export { getMy, patchMy, withdraw };
Expand Down
2 changes: 1 addition & 1 deletion src/api/quetion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type BodyPatchAnswer = {
};

async function patchAnswer(param: ParamPatchAnswer, body: BodyPatchAnswer) {
const apiUrl = createUrl(questionApis.patchAnser, { param });
const apiUrl = createUrl(questionApis.patchAnswer, { param });
return await kyInstance.patch(apiUrl, { json: body }).json();
}

Expand Down
2 changes: 1 addition & 1 deletion src/api/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const questionApis = {
getQuestion: 'question/:family-id',
postAnswer: 'question/answer',
getAnswer: 'question/answer/:question-history-id',
patchAnser: 'question/answer/:answer-id',
patchAnswer: 'question/answer/:answer-id',
getList: 'question/answer/:family-id',
cheerUp: 'question/alert/cheer-up',
};
Expand Down

0 comments on commit 4567aa8

Please sign in to comment.