forked from openedx/frontend-app-authoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from open-craft/kshitij/use-custom-grade-range…
…-redwood feat: Use configured DEFAULT_GRADE_DESIGNATIONS
- Loading branch information
Showing
10 changed files
with
232 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; | ||
import { getCourseSettings, getGradingSettings, sendGradingSettings } from './api'; | ||
|
||
export const useGradingSettings = (courseId) => ( | ||
useQuery({ | ||
queryKey: ['gradingSettings', courseId], | ||
queryFn: () => getGradingSettings(courseId), | ||
}) | ||
); | ||
|
||
export const useCourseSettings = (courseId) => ( | ||
useQuery({ | ||
queryKey: ['courseSettings', courseId], | ||
queryFn: () => getCourseSettings(courseId), | ||
}) | ||
); | ||
|
||
export const useGradingSettingUpdater = (courseId) => { | ||
const queryClient = useQueryClient(); | ||
return useMutation({ | ||
mutationFn: (settings) => sendGradingSettings(courseId, settings), | ||
onSettled: () => { | ||
queryClient.invalidateQueries({ queryKey: ['gradingSettings', courseId] }); | ||
}, | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.