-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: modify getTodayQuestion API for sync api doc
- Loading branch information
1 parent
489ed17
commit 55e3a23
Showing
1 changed file
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}; |