Rename and move files
This commit is contained in:
parent
2c181d49b0
commit
b48114b8bb
7 changed files with 7 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
import { createContext, useContext, useEffect, useState } from 'react';
|
||||
import { getUser, registerUser } from '../services/user-service';
|
||||
import { getUser, registerUser } from '../utils/mocks/api';
|
||||
|
||||
const AuthContext = createContext();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { createContext, useContext, useEffect, useState } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { UserServiceProvider } from '../services/user-service-provider';
|
||||
import { UserServiceProvider } from '../services/provider';
|
||||
import { useAuthState } from './auth';
|
||||
|
||||
const UserContext = createContext();
|
||||
|
|
|
@ -4,13 +4,13 @@ export const UserServiceProvider = (function () {
|
|||
async function createInstance(user) {
|
||||
switch (user.role) {
|
||||
case 'STUDENT':
|
||||
const studentService = await import('../services/student-service');
|
||||
const studentService = await import('./student');
|
||||
if (studentService) {
|
||||
return new studentService.default(user);
|
||||
}
|
||||
break;
|
||||
case 'PROFESSOR':
|
||||
const professorService = await import('../services/professor-service');
|
||||
const professorService = await import('./professor');
|
||||
if (professorService) {
|
||||
return new professorService.default(user);
|
||||
}
|
|
@ -8,7 +8,7 @@ import {
|
|||
getFaq,
|
||||
getPeopleByClassId,
|
||||
getUpcomingAssignmentsByClassId,
|
||||
} from './user-service';
|
||||
} from '../utils/mocks/api';
|
||||
|
||||
export default class StudentService {
|
||||
constructor(user) {
|
|
@ -1,4 +1,4 @@
|
|||
import { sleep } from '../utils/sleep';
|
||||
import { sleep } from '../sleep';
|
||||
import {
|
||||
allClassrooms,
|
||||
allAssignments,
|
||||
|
@ -9,7 +9,7 @@ import {
|
|||
allClassroomAnnouncements,
|
||||
allUpcomingAssignments,
|
||||
allPeople,
|
||||
} from './mocks';
|
||||
} from './responses';
|
||||
|
||||
const getClassrooms = userId =>
|
||||
sleep(300).then(() => {
|
Loading…
Reference in a new issue