Rename and move files

This commit is contained in:
Leonardo Murça 2022-11-29 11:41:23 -03:00
parent 2c181d49b0
commit b48114b8bb
7 changed files with 7 additions and 7 deletions

View file

@ -1,5 +1,5 @@
import { createContext, useContext, useEffect, useState } from 'react'; import { createContext, useContext, useEffect, useState } from 'react';
import { getUser, registerUser } from '../services/user-service'; import { getUser, registerUser } from '../utils/mocks/api';
const AuthContext = createContext(); const AuthContext = createContext();

View file

@ -1,6 +1,6 @@
import { createContext, useContext, useEffect, useState } from 'react'; import { createContext, useContext, useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom'; import { useLocation } from 'react-router-dom';
import { UserServiceProvider } from '../services/user-service-provider'; import { UserServiceProvider } from '../services/provider';
import { useAuthState } from './auth'; import { useAuthState } from './auth';
const UserContext = createContext(); const UserContext = createContext();

View file

@ -4,13 +4,13 @@ export const UserServiceProvider = (function () {
async function createInstance(user) { async function createInstance(user) {
switch (user.role) { switch (user.role) {
case 'STUDENT': case 'STUDENT':
const studentService = await import('../services/student-service'); const studentService = await import('./student');
if (studentService) { if (studentService) {
return new studentService.default(user); return new studentService.default(user);
} }
break; break;
case 'PROFESSOR': case 'PROFESSOR':
const professorService = await import('../services/professor-service'); const professorService = await import('./professor');
if (professorService) { if (professorService) {
return new professorService.default(user); return new professorService.default(user);
} }

View file

@ -8,7 +8,7 @@ import {
getFaq, getFaq,
getPeopleByClassId, getPeopleByClassId,
getUpcomingAssignmentsByClassId, getUpcomingAssignmentsByClassId,
} from './user-service'; } from '../utils/mocks/api';
export default class StudentService { export default class StudentService {
constructor(user) { constructor(user) {

View file

@ -1,4 +1,4 @@
import { sleep } from '../utils/sleep'; import { sleep } from '../sleep';
import { import {
allClassrooms, allClassrooms,
allAssignments, allAssignments,
@ -9,7 +9,7 @@ import {
allClassroomAnnouncements, allClassroomAnnouncements,
allUpcomingAssignments, allUpcomingAssignments,
allPeople, allPeople,
} from './mocks'; } from './responses';
const getClassrooms = userId => const getClassrooms = userId =>
sleep(300).then(() => { sleep(300).then(() => {