Compare commits
5 Commits
0be7eab696
...
eae3fe2154
Author | SHA1 | Date | |
---|---|---|---|
eae3fe2154 | |||
4f511bf066 | |||
62f64eed60 | |||
58a4c87661 | |||
f52cb31189 |
@ -4,5 +4,6 @@ public enum Role {
|
||||
Teacher,
|
||||
Student,
|
||||
Admin,
|
||||
InscriptionService,
|
||||
Secretary;
|
||||
}
|
||||
|
@ -18,8 +18,3 @@ var dev = tasks.register<NpmTask>("dev") {
|
||||
tasks.register<NpmTask>("run") {
|
||||
dependsOn(dev)
|
||||
}
|
||||
|
||||
tasks.register<NpmTask>("test") {
|
||||
dependsOn(tasks.npmInstall)
|
||||
args.set(listOf("run", "test:unit"))
|
||||
}
|
||||
|
@ -18,6 +18,25 @@ export async function getUser(id){
|
||||
return restGet(endpoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Alterable datas of user.
|
||||
* usage by secretary
|
||||
*
|
||||
* @param id regno of the user
|
||||
* @param data data to change
|
||||
*
|
||||
* - lastName
|
||||
* - firstName
|
||||
* - birthDate
|
||||
* - role
|
||||
* - email
|
||||
* - photo
|
||||
* - Adress
|
||||
*/
|
||||
export async function alterUser(id, data){
|
||||
return restPatch("/user/" + id, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reserved for secretary roles. Allow to list all user on the plateform
|
||||
*/
|
||||
@ -25,3 +44,27 @@ export async function getAllUsers(){
|
||||
return restGet("/users");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get informations about yourself
|
||||
* - RegNo
|
||||
* - FirstName / LastName
|
||||
* - email
|
||||
* - adressId (?)
|
||||
* - birthDate
|
||||
* - role
|
||||
*/
|
||||
export async function getSelf(){
|
||||
return restGet("/user");
|
||||
}
|
||||
|
||||
/**
|
||||
* Alterable datas are
|
||||
* - email
|
||||
* - photo
|
||||
* - Adress
|
||||
* - Password
|
||||
*/
|
||||
export async function alterSelf(data){
|
||||
return restPatch("/user", data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user