mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-12 14:20:08 +02:00
Add email and error message when duplicate email at registration
This commit is contained in:
@@ -30,6 +30,9 @@ export default class ServiceAccessors<
|
||||
...axiosConfig,
|
||||
params: { id },
|
||||
})
|
||||
if (data.error) {
|
||||
throw Error(data.error)
|
||||
}
|
||||
return { data }
|
||||
} catch (error) {
|
||||
return { error: error as Error }
|
||||
@@ -51,6 +54,9 @@ export default class ServiceAccessors<
|
||||
`${config.API_URL}/${this.elementName}ListGet`,
|
||||
axiosConfig
|
||||
)
|
||||
if (data.error) {
|
||||
throw Error(data.error)
|
||||
}
|
||||
return { data }
|
||||
} catch (error) {
|
||||
return { error: error as Error }
|
||||
@@ -100,6 +106,9 @@ export default class ServiceAccessors<
|
||||
volunteerWithoutId,
|
||||
axiosConfig
|
||||
)
|
||||
if (data.error) {
|
||||
throw Error(data.error)
|
||||
}
|
||||
return { data }
|
||||
} catch (error) {
|
||||
return { error: error as Error }
|
||||
@@ -122,6 +131,9 @@ export default class ServiceAccessors<
|
||||
volunteer,
|
||||
axiosConfig
|
||||
)
|
||||
if (data.error) {
|
||||
throw Error(data.error)
|
||||
}
|
||||
return { data }
|
||||
} catch (error) {
|
||||
return { error: error as Error }
|
||||
@@ -143,6 +155,9 @@ export default class ServiceAccessors<
|
||||
`${config.API_URL}/${this.elementName}CountGet`,
|
||||
axiosConfig
|
||||
)
|
||||
if (data.error) {
|
||||
throw Error(data.error)
|
||||
}
|
||||
return { data }
|
||||
} catch (error) {
|
||||
return { error: error as Error }
|
||||
|
@@ -24,7 +24,7 @@ export class Volunteer implements VolunteerPartial {
|
||||
|
||||
dayWishesComment = ""
|
||||
|
||||
tshirtCount = ""
|
||||
tshirtCount = 0
|
||||
|
||||
tshirtSize = ""
|
||||
|
||||
@@ -92,12 +92,6 @@ export class VolunteerPartial {
|
||||
mobile = ""
|
||||
}
|
||||
|
||||
export class VolunteerPartialAddReturn {
|
||||
id = 0
|
||||
|
||||
password = ""
|
||||
}
|
||||
|
||||
export const elementName = "Volunteer"
|
||||
|
||||
export const volunteerExample: Volunteer = {
|
||||
@@ -113,7 +107,7 @@ export const volunteerExample: Volunteer = {
|
||||
discordId: "",
|
||||
dayWishes: [],
|
||||
dayWishesComment: "",
|
||||
tshirtCount: "1",
|
||||
tshirtCount: 1,
|
||||
tshirtSize: "Femme M",
|
||||
food: "Végétarien",
|
||||
teamWishes: [],
|
||||
|
Reference in New Issue
Block a user