Add login api

This commit is contained in:
pikiou
2022-01-03 17:55:47 +01:00
parent 4540e92171
commit 395955f32a
36 changed files with 340 additions and 437 deletions

View File

@@ -23,7 +23,7 @@ export class Volunteer {
comment = ""
timestamp = ""
timestamp = new Date()
password = ""
}
@@ -50,22 +50,18 @@ export const emailRegexp =
/^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/i
export const passwordMinLength = 4
export interface VolunteerLogin {
volunteer?: {
firstname: string
}
jwt?: string
error?: string
}
export type VolunteerWithoutId = Omit<Volunteer, "id">
const { listGet, get, set, add } = getServiceAccessors<VolunteerWithoutId, Volunteer>(
elementName,
translationVolunteer
)
const accessors = getServiceAccessors<VolunteerWithoutId, Volunteer>(elementName)
const { listGet, get, set, add } = accessors
export const volunteerListGet = listGet()
export const volunteerGet = get()
export const volunteerAdd = add()
export const volunteerSet = set()
export interface VolunteerLogin {
firstname: string
jwt: string
}
export const volunteerLogin = accessors.customPost("Login")