getTaskList実装

This commit is contained in:
rca 2024-07-19 01:59:17 +09:00
parent 268d7b1847
commit 983e5976f5

View File

@ -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;
}