mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-11 22:06:29 +02:00
Add register form, missing proper feedback on error or success
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export class PreVolunteer {
|
||||
export class Postulant {
|
||||
id = 0
|
||||
|
||||
firstname = ""
|
||||
@@ -9,25 +9,25 @@ export class PreVolunteer {
|
||||
|
||||
mobile = ""
|
||||
|
||||
alreadyVolunteer = false
|
||||
potential = false
|
||||
|
||||
comment = ""
|
||||
}
|
||||
|
||||
export const translationPreVolunteer: { [k in keyof PreVolunteer]: string } = {
|
||||
export const translationPostulant: { [k in keyof Postulant]: string } = {
|
||||
id: "id",
|
||||
firstname: "prenom",
|
||||
lastname: "nom",
|
||||
email: "email",
|
||||
mobile: "telephone",
|
||||
alreadyVolunteer: "dejaBenevole",
|
||||
potential: "potentiel",
|
||||
comment: "commentaire",
|
||||
}
|
||||
|
||||
export const elementName = "PreVolunteer"
|
||||
export const elementName = "Postulant"
|
||||
|
||||
export const emailRegexp =
|
||||
/^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/i
|
||||
export const passwordMinLength = 4
|
||||
|
||||
export type PreVolunteerWithoutId = Omit<PreVolunteer, "id">
|
||||
export type PostulantWithoutId = Omit<Postulant, "id">
|
9
src/services/postulantsAccessors.ts
Normal file
9
src/services/postulantsAccessors.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import ServiceAccessors from "./accessors"
|
||||
import { elementName, Postulant, PostulantWithoutId } from "./postulants"
|
||||
|
||||
const serviceAccessors = new ServiceAccessors<PostulantWithoutId, Postulant>(elementName)
|
||||
|
||||
export const postulantListGet = serviceAccessors.listGet()
|
||||
export const postulantGet = serviceAccessors.get()
|
||||
export const postulantAdd = serviceAccessors.add()
|
||||
export const postulantSet = serviceAccessors.set()
|
@@ -1,10 +0,0 @@
|
||||
import ServiceAccessors from "./accessors"
|
||||
import { elementName, PreVolunteer, PreVolunteerWithoutId } from "./preVolunteers"
|
||||
|
||||
const serviceAccessors = new ServiceAccessors<PreVolunteerWithoutId, PreVolunteer>(elementName)
|
||||
|
||||
export const preVolunteerListGet = serviceAccessors.listGet()
|
||||
export const preVolunteerGet = serviceAccessors.get()
|
||||
export const preVolunteerAdd = serviceAccessors.add()
|
||||
export const preVolunteerSet = serviceAccessors.set()
|
||||
export const preVolunteerCountGet = serviceAccessors.countGet()
|
@@ -1,4 +1,5 @@
|
||||
export class Volunteer {
|
||||
/* eslint-disable max-classes-per-file */
|
||||
export class Volunteer implements VolunteerPartial {
|
||||
id = 0
|
||||
|
||||
lastname = ""
|
||||
@@ -9,7 +10,7 @@ export class Volunteer {
|
||||
|
||||
mobile = ""
|
||||
|
||||
photo = ""
|
||||
photo = "anonyme.png"
|
||||
|
||||
adult = 1
|
||||
|
||||
@@ -27,7 +28,7 @@ export class Volunteer {
|
||||
|
||||
tshirtSize = ""
|
||||
|
||||
food = ""
|
||||
food = "Aucune"
|
||||
|
||||
teamWishes: number[] = []
|
||||
|
||||
@@ -72,6 +73,22 @@ export const translationVolunteer: { [k in keyof Volunteer]: string } = {
|
||||
acceptsNotifs: "accepteLesNotifs",
|
||||
}
|
||||
|
||||
export class VolunteerPartial {
|
||||
lastname = ""
|
||||
|
||||
firstname = ""
|
||||
|
||||
email = ""
|
||||
|
||||
mobile = ""
|
||||
}
|
||||
|
||||
export class VolunteerPartialAddReturn {
|
||||
id = 0
|
||||
|
||||
password = ""
|
||||
}
|
||||
|
||||
export const elementName = "Volunteer"
|
||||
|
||||
export const volunteerExample: Volunteer = {
|
||||
|
@@ -13,7 +13,7 @@ const serviceAccessors = new ServiceAccessors<VolunteerWithoutId, Volunteer>(ele
|
||||
|
||||
export const volunteerListGet = serviceAccessors.listGet()
|
||||
export const volunteerGet = serviceAccessors.get()
|
||||
export const volunteerAdd = serviceAccessors.add()
|
||||
export const volunteerPartialAdd = serviceAccessors.customPost<[Partial<Volunteer>]>("PartialAdd")
|
||||
export const volunteerSet = serviceAccessors.set()
|
||||
|
||||
export const volunteerLogin =
|
||||
|
Reference in New Issue
Block a user