Skip to content

Commit

Permalink
Fix: create/update question response type 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dongree committed Nov 19, 2023
1 parent 2ca84eb commit bf10e2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/create/QuestionEditorForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function QuestionEditorForm() {
return;
}
notifyToast('성공적으로 등록되었습니다.', 'success');
router.push(`/questions/${res.id}`);
router.push(`/questions/${res.questionId}`);
router.refresh();
});
};
Expand Down
4 changes: 2 additions & 2 deletions src/service/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function getQuestionsByMemoId(
export async function createQuestion(
bodyData: PostQuestionData,
memoId: number
): Promise<Question | ErrorResponse> {
): Promise<{ questionId: number; message: string } | ErrorResponse> {
const url = new URL(`${process.env.NEXT_PUBLIC_SERVER_IP_ADDRESS}/questions`);
if (memoId) {
const params = { memoId: memoId.toString() };
Expand All @@ -83,7 +83,7 @@ export async function createQuestion(
export async function updateQuestion(
bodyData: PostQuestionData,
id: number
): Promise<Question | ErrorResponse> {
): Promise<IsSuccessResponse | ErrorResponse> {
return fetch(`${process.env.NEXT_PUBLIC_SERVER_IP_ADDRESS}/questions/${id}`, {
method: 'PUT',
headers: {
Expand Down

0 comments on commit bf10e2a

Please sign in to comment.