Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 105x 3x 3x 1x 2x 2x 105x | import { useMutation } from "@tanstack/react-query";
import { API } from "aws-amplify";
type GroupDivisionParams = {
group: string;
division: string;
};
export const submitGroupDivision = async (
params: GroupDivisionParams,
): Promise<{ message: string }> => {
try {
const submitGroupAndDivisionInfo = await API.post("os", "/submitGroupDivision", {
body: params,
});
return submitGroupAndDivisionInfo;
} catch (error) {
console.error(error.message);
throw new Error("Failed to submit group and division: ", error);
}
};
export const useSubmitGroupDivision = () => {
return useMutation<{ message: string }, Error, GroupDivisionParams>({
mutationFn: (params) => submitGroupDivision(params),
});
};
|