1
0
forked from PGL/Clyde

post User by secretary

This commit is contained in:
2024-04-21 23:14:56 +02:00
parent 608b6e4893
commit 1a266cdfbd
10 changed files with 208 additions and 90 deletions

View File

@ -13,6 +13,10 @@ export function disconnect(){
setCookie("session_token", ";expires= Thu, 01 Jan 1970 00:00:01 GMT")
}
export async function patchUser(id,data){
return restPatch("/user/" +id, data)
}
/**
* Register a user (tokenless)
*
@ -43,31 +47,8 @@ export async function register(firstname, lastname, birthDate, password, email,
});
}
/**
* Register a user (by secretary)
*
* @param firstname
* @param lastname
* @param birthdate
* @param password
* @param mail
* @param address
* @param country
* @param imageId id of the image in database returned when uploaded
*
* PS: the password is not required as it is generated by the backend and sent to the user
* by mail. it's up to the user to change it if he cares about security
*/
export async function createUser(firstname, lastname, birthDate, email, address, country, role, imageId){
return restPost("/user", {
firstname: firstname,
lastname: lastname,
birthDate: birthDate,
password: password,
email: email,
address: address,
country: country,
});
export async function postUser(data){
return restPost("/user", data)
}
/**

View File

@ -15,6 +15,7 @@ import ManageRequests from "@/Apps/Inscription/ManageRequests.vue";
import ManageResearcherProfile from "@/Apps/ScientificPublications/ManageResearcherProfile.vue";
import ListResearches from "@/Apps/ScientificPublications/ListResearches.vue";
import ResearcherProfile from "@/Apps/ScientificPublications/ResearcherProfile.vue";
import CreateUser from "@/Apps/CreateUser.vue";
const apps = {
'/login': LoginPage,
@ -26,7 +27,8 @@ const apps = {
'/manage-researcher-profile' : ManageResearcherProfile,
'/msg' : Msg,
'/researches' : ListResearches,
'/researcher-profile': ResearcherProfile
'/researcher-profile': ResearcherProfile,
'/create-user': CreateUser
}
const appsList = {
@ -40,6 +42,7 @@ const appsList = {
'StudentsList':{ path: '#/students-list',icon: 'fa-users',text: i18n("app.studentList")},
'UsersList':{ path: '#/users-list',icon: 'fa-users',text: i18n("app.users")},
'ManageResearcherProfile':{path:'#/manage-researcher-profile',icon:'fa-book-bookmark',text:i18n("app.manage.researcherProfile")},
'CreateUser':{path:'#/create-user',icon:'fa-plus', text:i18n("app.Create.User")}
}