mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-06-29 16:55:46 +08:00
Code cleanup for multiple pages and components
This commit is contained in:
parent
14e14b8bb6
commit
68778cea7a
5 changed files with 22 additions and 13 deletions
|
@ -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])));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue