Skip to content

Commit

Permalink
feat: modify getTodayQuestion API for sync api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
timepresent95 committed Aug 19, 2024
1 parent 489ed17 commit 55e3a23
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/api/quetion.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import {kyInstance} from './ky';

type ResponseTodayQuestion = {
type ParamGetQuestion = {
familyId: string;
};

type ResponseGetQuestion = {
questionHistoryId: string;
question: string;
isAnswered: boolean;
};

async function getTodayQuestion() {
async function getQuestion({familyId}: ParamGetQuestion) {
return (await kyInstance
.get('question/today')
.json()) as ResponseTodayQuestion;
.get(`question/${familyId}`)
.json()) as ResponseGetQuestion;
}

export {getTodayQuestion};
export type {ResponseTodayQuestion};
export {getQuestion};
export type {ParamGetQuestion, ResponseGetQuestion};

0 comments on commit 55e3a23

Please sign in to comment.