diff --git a/src/Pages/CreateUser/sections.js b/src/Pages/CreateUser/sections.js index 88d8355..def3855 100644 --- a/src/Pages/CreateUser/sections.js +++ b/src/Pages/CreateUser/sections.js @@ -1,56 +1,60 @@ export const SectionsList = () => { - return ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); + return ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); }; diff --git a/src/Services/Axios/processService.js b/src/Services/Axios/processService.js index 93a49d2..7ef9b29 100644 --- a/src/Services/Axios/processService.js +++ b/src/Services/Axios/processService.js @@ -1,5 +1,4 @@ import { APIProcess } from "./BaseService"; -import axios from "axios"; import GenericBlueButton from "../../Components/GenericBlueButton"; export async function getAllProcess(toast) { @@ -30,10 +29,8 @@ export async function getProcessByID(ID, toast) { export async function getProcessByPage(page, toast) { try { - console.log("dentro da funcao"); const response = await APIProcess.get(`/records/page/${page}`); - console.log(`"papapapap",${JSON.stringify(response)}`); return response.data; } catch (error) { toast.error("Erro ao buscar registro!"); @@ -62,8 +59,7 @@ export async function createRecord(recordInfo, toast) {

{record.data.register_number}

toast.dismiss(t.id)} - > + onClick={() => toast.dismiss(t.id)}> )); } catch (err) { diff --git a/src/Services/Axios/profileService.js b/src/Services/Axios/profileService.js index aff099e..ba7a81e 100644 --- a/src/Services/Axios/profileService.js +++ b/src/Services/Axios/profileService.js @@ -44,6 +44,14 @@ export async function registerUser(usr, toast) { try { const user = await validateUser(usr); + if (user.departmentID <= 7) { + // user belongs to a admin sector + user.sectionID = 0; + } else { + // user is a common user + user.departmentID = 0; + } + await APIProfile.post( "/register", { @@ -62,13 +70,9 @@ export async function registerUser(usr, toast) { const status = err.response?.status; if (status === 401) { - toast.error( - "Você não possui privilégios suficientes para realizar esta ação" - ); + toast.error("Você não possui privilégios suficientes para realizar esta ação"); } else if (status === 400) { - toast.error( - "Faltam algumas informações para realizar o cadastro do usuário" - ); + toast.error("Faltam algumas informações para realizar o cadastro do usuário"); } else { toast.error(`Erro ao cadastrar usuário!`); } @@ -117,9 +121,7 @@ export async function listAllUsers(toast) { const status = err.response?.status; if (status === 401) { - toast.error( - "Você não possui privilégios suficientes para realizar esta ação" - ); + toast.error("Você não possui privilégios suficientes para realizar esta ação"); } } }