mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-11 05:46:28 +02:00
Move database accessors in separate files to separate them from database definitions
This commit is contained in:
36
src/services/volunteersAccessors.ts
Normal file
36
src/services/volunteersAccessors.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import ServiceAccessors from "./accessors"
|
||||
import {
|
||||
elementName,
|
||||
Volunteer,
|
||||
VolunteerDayWishes,
|
||||
VolunteerNotifs,
|
||||
VolunteerParticipationDetails,
|
||||
VolunteerTeamWishes,
|
||||
VolunteerWithoutId,
|
||||
} from "./volunteers"
|
||||
|
||||
const serviceAccessors = new ServiceAccessors<VolunteerWithoutId, Volunteer>(elementName)
|
||||
|
||||
export const volunteerListGet = serviceAccessors.listGet()
|
||||
export const volunteerGet = serviceAccessors.get()
|
||||
export const volunteerAdd = serviceAccessors.add()
|
||||
export const volunteerSet = serviceAccessors.set()
|
||||
|
||||
export const volunteerLogin =
|
||||
serviceAccessors.customPost<[{ email: string; password: string }]>("Login")
|
||||
|
||||
export const volunteerForgot = serviceAccessors.customPost<[{ email: string }]>("Forgot")
|
||||
|
||||
export const volunteerNotifsSet =
|
||||
serviceAccessors.securedCustomPost<[number, Partial<VolunteerNotifs>]>("NotifsSet")
|
||||
|
||||
export const volunteerTeamWishesSet =
|
||||
serviceAccessors.securedCustomPost<[number, Partial<VolunteerTeamWishes>]>("TeamWishesSet")
|
||||
|
||||
export const volunteerDayWishesSet =
|
||||
serviceAccessors.securedCustomPost<[number, Partial<VolunteerDayWishes>]>("DayWishesSet")
|
||||
|
||||
export const volunteerParticipationDetailsSet =
|
||||
serviceAccessors.securedCustomPost<[number, Partial<VolunteerParticipationDetails>]>(
|
||||
"ParticipationDetailsSet"
|
||||
)
|
Reference in New Issue
Block a user