feat(#112): aligner reprise front sur dossier complet GET/PATCH
Préremplit parents, enfants, motivation et fiche AM depuis reprise-dossier et envoie le body PATCH complet (co-parent, enfants par id, champs pro AM). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import '../../models/card_assets.dart';
|
||||
import '../../config/display_config.dart';
|
||||
import '../../services/auth_service.dart';
|
||||
import '../../services/reprise_session.dart';
|
||||
import '../../utils/reprise_payload.dart';
|
||||
import '../../widgets/hover_relief_widget.dart';
|
||||
import '../../widgets/image_button.dart';
|
||||
import '../../widgets/custom_navigation_button.dart';
|
||||
@@ -59,14 +60,11 @@ class _AmRegisterStep4ScreenState extends State<AmRegisterStep4Screen> {
|
||||
try {
|
||||
if (RepriseSession.isActive) {
|
||||
await AuthService.resoumettreReprise(
|
||||
token: RepriseSession.token!,
|
||||
prenom: registrationData.firstName,
|
||||
nom: registrationData.lastName,
|
||||
telephone: registrationData.phone,
|
||||
adresse: registrationData.streetAddress,
|
||||
ville: registrationData.city,
|
||||
codePostal: registrationData.postalCode,
|
||||
photoUrl: RepriseSession.photoUrl,
|
||||
await ReprisePayload.amPatch(
|
||||
registrationData,
|
||||
RepriseSession.token!,
|
||||
existingPhotoUrl: RepriseSession.photoUrlForApi,
|
||||
),
|
||||
);
|
||||
RepriseSession.clear();
|
||||
if (!mounted) return;
|
||||
|
||||
@@ -15,6 +15,7 @@ import '../../widgets/child_card_widget.dart';
|
||||
import '../../widgets/presentation_form_screen.dart';
|
||||
import '../../services/auth_service.dart';
|
||||
import '../../services/reprise_session.dart';
|
||||
import '../../utils/reprise_payload.dart';
|
||||
|
||||
class ParentRegisterStep5Screen extends StatefulWidget {
|
||||
const ParentRegisterStep5Screen({super.key});
|
||||
@@ -33,7 +34,7 @@ class _ParentRegisterStep5ScreenState extends State<ParentRegisterStep5Screen> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'Vérifiez vos coordonnées et acceptez les conditions.',
|
||||
'Vérifiez vos coordonnées, les enfants et acceptez les conditions.',
|
||||
style: GoogleFonts.merienda(fontSize: 14),
|
||||
),
|
||||
backgroundColor: Colors.red.shade700,
|
||||
@@ -46,15 +47,8 @@ class _ParentRegisterStep5ScreenState extends State<ParentRegisterStep5Screen> {
|
||||
try {
|
||||
if (RepriseSession.isActive) {
|
||||
final token = RepriseSession.token!;
|
||||
final p = data.parent1;
|
||||
await AuthService.resoumettreReprise(
|
||||
token: token,
|
||||
prenom: p.firstName,
|
||||
nom: p.lastName,
|
||||
telephone: p.phone,
|
||||
adresse: p.address,
|
||||
ville: p.city,
|
||||
codePostal: p.postalCode,
|
||||
ReprisePayload.parentPatch(data, token),
|
||||
);
|
||||
RepriseSession.clear();
|
||||
if (!context.mounted) return;
|
||||
|
||||
Reference in New Issue
Block a user