mirror of
https://github.com/r-ca/kidshift-web.git
synced 2024-10-25 16:34:01 +00:00
getTaskList実装
This commit is contained in:
parent
268d7b1847
commit
983e5976f5
|
@ -1,5 +1,6 @@
|
|||
import { api } from 'boot/axios';
|
||||
import { ChildDetailsResponse } from 'src/models/child';
|
||||
import { TaskListResponse } from 'src/models/task';
|
||||
|
||||
export const sendPing = async (): Promise<string> => {
|
||||
const response = await api.get('/meta/ping');
|
||||
|
@ -18,3 +19,11 @@ export const getChildDetails = async (childId: string): Promise<ChildDetailsResp
|
|||
}
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export const getTaskList = async (): Promise<TaskListResponse> => {
|
||||
const response = await api.get(`/task`);
|
||||
if (response.status !== 200) {
|
||||
throw new Error('タスク情報の取得に失敗しました');
|
||||
}
|
||||
return response.data;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user