Login and register ok and starting requests
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
*
|
||||
* TODO: On time of writing, the backend doesn't support these endpoints so it could be modified in the future.
|
||||
*/
|
||||
import {restGet, restPatch} from './restConsumer.js'
|
||||
import {restGet, restPatch,restPatchInfo} from './restConsumer.js'
|
||||
|
||||
/**
|
||||
* create a new register requests that can be recovered by the registering service
|
||||
@ -41,5 +41,5 @@ export async function getAllRegisters(){
|
||||
* Change the state of a requests.
|
||||
*/
|
||||
export async function validateRegister(id, state){
|
||||
return restPatch("/request/register/" + id, {state: state});
|
||||
return restPatch("/request/register/" + id, state);
|
||||
}
|
||||
|
@ -28,14 +28,15 @@ export function disconnect(){
|
||||
*/
|
||||
export async function register(firstname, lastname, birthDate, password, email, address, country, curriculumId, imageId){
|
||||
return restPost("/register", {
|
||||
firstname: firstname,
|
||||
lastname: lastname,
|
||||
firstName: firstname,
|
||||
lastName: lastname,
|
||||
birthDate: birthDate,
|
||||
password: password,
|
||||
email: email,
|
||||
address: address,
|
||||
country: country,
|
||||
curriculumId: curriculumId
|
||||
curriculumId: curriculumId,
|
||||
profilePictureUrl: imageId,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@ export async function restPost(endPoint, data) {
|
||||
return await _rest(endPoint, {method: "POST", credentials: 'include', body: JSON.stringify(data)});
|
||||
}
|
||||
|
||||
|
||||
export async function restPostFile(endPoint, file){
|
||||
let headers = new Headers();
|
||||
return await _rest(endPoint, {method: "POST", credentials: 'include', body: file, headers: headers });
|
||||
@ -24,6 +25,10 @@ export async function restPatch(endPoint, data) {
|
||||
return await _rest(endPoint, {method: "PATCH", credentials: 'include', body: JSON.stringify(data)});
|
||||
}
|
||||
|
||||
export async function restPatchInfo(endPoint, data){
|
||||
return await _rest(endPoint, {method: "PATCH", credentials: 'include', body: data});
|
||||
}
|
||||
|
||||
/**
|
||||
* backbone for the request made by the frontend
|
||||
*
|
||||
|
Reference in New Issue
Block a user