mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
updating font
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
useMutation,
|
||||
} from "@tanstack/react-query";
|
||||
import { useCourseContext } from "@/app/course/[courseName]/context/courseContext";
|
||||
import { axiosClient } from "@/services/axiosUtils";
|
||||
|
||||
export const getAssignmentNamesQueryConfig = (
|
||||
courseName: string,
|
||||
@@ -22,7 +23,7 @@ export const getAssignmentNamesQueryConfig = (
|
||||
"/modules/" +
|
||||
encodeURIComponent(moduleName) +
|
||||
"/assignments";
|
||||
const response = await axios.get(url);
|
||||
const response = await axiosClient.get(url);
|
||||
return response.data;
|
||||
},
|
||||
});
|
||||
@@ -53,7 +54,7 @@ export const getAssignmentQueryConfig = (
|
||||
encodeURIComponent(moduleName) +
|
||||
"/assignments/" +
|
||||
encodeURIComponent(assignmentName);
|
||||
const response = await axios.get(url);
|
||||
const response = await axiosClient.get(url);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
@@ -110,7 +111,7 @@ export const useUpdateAssignmentMutation = () => {
|
||||
encodeURIComponent(moduleName) +
|
||||
"/assignments/" +
|
||||
encodeURIComponent(assignmentName);
|
||||
await axios.put(url, assignment);
|
||||
await axiosClient.put(url, assignment);
|
||||
},
|
||||
onSuccess: (_, { moduleName, assignmentName }) => {
|
||||
queryClient.invalidateQueries({
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
} from "@tanstack/react-query";
|
||||
import axios from "axios";
|
||||
import { localCourseKeys } from "./localCourseKeys";
|
||||
import { axiosClient } from "@/services/axiosUtils";
|
||||
import {
|
||||
getAssignmentNamesQueryConfig,
|
||||
getAssignmentQueryConfig,
|
||||
@@ -23,7 +24,7 @@ export const useLocalCourseNamesQuery = () =>
|
||||
queryKey: localCourseKeys.allCourses,
|
||||
queryFn: async (): Promise<string[]> => {
|
||||
const url = `/api/courses`;
|
||||
const response = await axios.get(url);
|
||||
const response = await axiosClient.get(url);
|
||||
return response.data;
|
||||
},
|
||||
});
|
||||
@@ -34,7 +35,7 @@ export const useLocalCourseSettingsQuery = () => {
|
||||
queryKey: localCourseKeys.settings(courseName),
|
||||
queryFn: async (): Promise<LocalCourseSettings> => {
|
||||
const url = `/api/courses/${courseName}/settings`;
|
||||
const response = await axios.get(url);
|
||||
const response = await axiosClient.get(url);
|
||||
return response.data;
|
||||
},
|
||||
});
|
||||
@@ -46,7 +47,7 @@ export const useModuleNamesQuery = () => {
|
||||
queryKey: localCourseKeys.moduleNames(courseName),
|
||||
queryFn: async (): Promise<string[]> => {
|
||||
const url = `/api/courses/${courseName}/modules`;
|
||||
const response = await axios.get(url);
|
||||
const response = await axiosClient.get(url);
|
||||
return response.data;
|
||||
},
|
||||
});
|
||||
@@ -185,7 +186,7 @@ export const useAllCourseDataQuery = () => {
|
||||
// previousCourse: LocalCourse;
|
||||
// }) => {
|
||||
// const url = `/api/courses/${courseName}`;
|
||||
// await axios.put(url, body);
|
||||
// await axiosClient.put(url, body);
|
||||
// },
|
||||
// onSuccess: () => {
|
||||
// queryClient.invalidateQueries({
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
import axios from "axios";
|
||||
import { localCourseKeys } from "./localCourseKeys";
|
||||
import { useCourseContext } from "@/app/course/[courseName]/context/courseContext";
|
||||
import { axiosClient } from "@/services/axiosUtils";
|
||||
|
||||
export function getPageNamesQueryConfig(
|
||||
courseName: string,
|
||||
@@ -23,7 +24,7 @@ export function getPageNamesQueryConfig(
|
||||
"/modules/" +
|
||||
encodeURIComponent(moduleName) +
|
||||
"/pages";
|
||||
const response = await axios.get(url);
|
||||
const response = await axiosClient.get(url);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
@@ -68,7 +69,7 @@ export function getPageQueryConfig(
|
||||
"/pages/" +
|
||||
encodeURIComponent(pageName);
|
||||
try {
|
||||
const response = await axios.get(url);
|
||||
const response = await axiosClient.get(url);
|
||||
return response.data;
|
||||
} catch (e) {
|
||||
console.log("error getting page", e, url);
|
||||
@@ -103,7 +104,7 @@ export const useUpdatePageMutation = () => {
|
||||
encodeURIComponent(moduleName) +
|
||||
"/pages/" +
|
||||
encodeURIComponent(pageName);
|
||||
await axios.put(url, page);
|
||||
await axiosClient.put(url, page);
|
||||
},
|
||||
onSuccess: (_, { moduleName, pageName }) => {
|
||||
queryClient.invalidateQueries({
|
||||
|
||||
@@ -6,9 +6,9 @@ import {
|
||||
useSuspenseQueries,
|
||||
useSuspenseQuery,
|
||||
} from "@tanstack/react-query";
|
||||
import axios from "axios";
|
||||
import { localCourseKeys } from "./localCourseKeys";
|
||||
import { useCourseContext } from "@/app/course/[courseName]/context/courseContext";
|
||||
import { axiosClient } from "@/services/axiosUtils";
|
||||
|
||||
|
||||
export function getQuizNamesQueryConfig(courseName: string, moduleName: string) {
|
||||
@@ -20,7 +20,7 @@ export function getQuizNamesQueryConfig(courseName: string, moduleName: string)
|
||||
"/modules/" +
|
||||
encodeURIComponent(moduleName) +
|
||||
"/quizzes";
|
||||
const response = await axios.get(url);
|
||||
const response = await axiosClient.get(url);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
@@ -63,7 +63,7 @@ export function getQuizQueryConfig(
|
||||
encodeURIComponent(moduleName) +
|
||||
"/quizzes/" +
|
||||
encodeURIComponent(quizName);
|
||||
const response = await axios.get(url);
|
||||
const response = await axiosClient.get(url);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
@@ -93,7 +93,7 @@ export const useUpdateQuizMutation = () => {
|
||||
encodeURIComponent(moduleName) +
|
||||
"/quizzes/" +
|
||||
encodeURIComponent(quizName);
|
||||
await axios.put(url, quiz);
|
||||
await axiosClient.put(url, quiz);
|
||||
},
|
||||
onSuccess: (_, { moduleName, quizName }) => {
|
||||
queryClient.invalidateQueries({
|
||||
|
||||
Reference in New Issue
Block a user