Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -30,7 +30,7 @@ class StaffAddForm {
|
||||
f4T2ExpirationDate: new FormControl<Date>(null, [Validators.required])
|
||||
})
|
||||
|
||||
staffPost = signal<CreateStaffDto>(this.staffForm.value);
|
||||
staffPost = signal<CreateStaffDto>(this.staffForm.value as any);
|
||||
staffsLoading = signal<boolean>(false);
|
||||
|
||||
async submitForm() {
|
||||
@@ -39,14 +39,14 @@ class StaffAddForm {
|
||||
|
||||
// Pour obtenir la valeur du formulaire
|
||||
console.log(this.staffForm.getRawValue())
|
||||
this.staffPost.set(this.staffForm.getRawValue())
|
||||
this.staffPost.set(this.staffForm.getRawValue() as any)
|
||||
|
||||
await this.createStaff(this.staffPost().lastName, this.staffPost().firstName, this.staffPost().profession, this.staffPost().email, this.staffPost().f4T2NumberApproval, this.staffPost().f4T2ExpirationDate)
|
||||
// Pour vider le formulaire
|
||||
this.staffForm.reset()
|
||||
}
|
||||
|
||||
async createStaff(lastname: string, firstname: string, profession: string, email: string, f4t2number: string, f4t2expiration: Date)
|
||||
async createStaff(lastname: string, firstname: string, profession: string, email: string, f4t2number: string, f4t2expiration: Date | string)
|
||||
{
|
||||
this.staffsLoading.set(true);
|
||||
|
||||
@@ -56,7 +56,7 @@ class StaffAddForm {
|
||||
profession: profession,
|
||||
email: email,
|
||||
f4T2NumberApproval: f4t2number,
|
||||
f4T2ExpirationDate: f4t2expiration
|
||||
f4T2ExpirationDate: f4t2expiration instanceof Date ? f4t2expiration.toISOString().split('T')[0] : f4t2expiration
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -15,6 +15,6 @@ export interface CreateStaffDto {
|
||||
profession?: string | null;
|
||||
email?: string | null;
|
||||
f4T2NumberApproval?: string | null;
|
||||
f4T2ExpirationDate?: Date | null;
|
||||
f4T2ExpirationDate?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@ export interface GetStaffDto {
|
||||
profession?: string | null;
|
||||
email?: string | null;
|
||||
f4T2NumberApproval?: string | null;
|
||||
f4T2ExpirationDate?: Date | null;
|
||||
f4T2ExpirationDate?: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user