update ednopints

This commit is contained in:
wrzesinski-hubert 2020-12-02 18:29:11 +01:00
parent e7d8e024d6
commit 08e9f84521
2 changed files with 15064 additions and 3 deletions

15061
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -110,7 +110,7 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => {
); );
try { try {
await axiosInstance.post(`${process.env.REACT_APP_API_URL}/api/v1/commisions/add?`, JSON.stringify(basketIds)); await axiosInstance.post(`${process.env.REACT_APP_API_URL}/api/v1/commisions/user`, JSON.stringify(basketIds));
enqueueSnackbar('Plan został zapisany', { enqueueSnackbar('Plan został zapisany', {
variant: 'success', variant: 'success',
action, action,
@ -156,7 +156,7 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => {
const getNewestTimetable = async () => { const getNewestTimetable = async () => {
try { try {
const { data } = await axiosInstance.get( const { data } = await axiosInstance.get(
`${process.env.REACT_APP_API_URL}/api/v1/assignments/getCurrentAssignments`, `${process.env.REACT_APP_API_URL}/api/v1/assignments/user`,
); );
const basket = data === '' ? [] : data; const basket = data === '' ? [] : data;
setBasket(basket); setBasket(basket);
@ -168,7 +168,7 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => {
const fetchCourses = async () => { const fetchCourses = async () => {
try { try {
const { data: courses } = await axiosInstance.get<Array<Course>>( const { data: courses } = await axiosInstance.get<Array<Course>>(
`${process.env.REACT_APP_API_URL}/api/v1/courses/getCoursesWithGroups`, `${process.env.REACT_APP_API_URL}/api/v1/courses/all?groups=true`,
); );
const sortedCourses = courses.sort((a, b) => (a.name > b.name ? 1 : -1)); const sortedCourses = courses.sort((a, b) => (a.name > b.name ? 1 : -1));
setCourses(sortedCourses); setCourses(sortedCourses);