Code cleanup for multiple pages and components

This commit is contained in:
Keannu Christian Bernasol 2023-09-20 21:16:54 +08:00
parent 14e14b8bb6
commit 68778cea7a
5 changed files with 22 additions and 13 deletions

View file

@ -8,6 +8,7 @@ import {
RootDrawerParamList,
StudentStatusType,
StudentStatusReturnType,
StudentStatusPatchType,
} from "../../interfaces/Interfaces";
import Button from "../../components/Button/Button";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
@ -61,7 +62,7 @@ export default function StartStudying({ route }: any) {
});
const mutation = useMutation({
mutationFn: async (info: StudentStatusType) => {
mutationFn: async (info: StudentStatusPatchType) => {
const data = await PatchStudentStatus(info);
if (data[0] == false) {
return Promise.reject(new Error(JSON.stringify(data[1])));