frontend/src/common/api.js
/** Tells the API to try to fix errors in given exams */
Tells the API to try to fix errors in given exams
Tells the API to try to fix errors in given exams
function useMutateFixImportQueueErrors(courseId, examsToFix) {
  const client = useQueryClient();
  return useMutation(
    () =>
      apiClient(`courses/${courseId}/import-queue/errors/fix`, {
        method: "POST",
        body: examsToFix.map((exam) => exam.fileId),
      }),
    {
      onSuccess() {
        client.invalidateQueries(["course", courseId, "import"]);
      },
    }
  );
}
function useMutateFixImportQueueErrors ( courseId , examsToFix ) { const client = useQueryClient ( ) ; return useMutation ( ( ) => apiClient ( ` ${ courseId } ` , { method : "POST" , body : examsToFix . map ( ( exam ) => exam . fileId ) , } ) , { onSuccess ( ) { client . invalidateQueries ( [ "course" , courseId , "import" ] ) ; } , } ) ; }
Tells the API to try to fix errors in given exams
Tells the API to try to fix errors in given exams