updateHomeownerApi function

Future<void> updateHomeownerApi({
  1. required BuildContext context,
  2. required String? firstName,
  3. required String? lastName,
})

Implementation

Future<void> updateHomeownerApi({
  required BuildContext context,
  required String? firstName,
  required String? lastName,
}) async {
  final container = ProviderScope.containerOf(context);

  final api = await container.read(energyManagementV3ApiProvider.future);

  final body = HomeownerUpdateV3Body(
    hasAcceptedTC: true,
    firstName: firstName,
    lastName: lastName,
  );
  final response = await api.kemApiV3HomeownerMePut(body: body);
  assertSuccessfulResponse(response);
  if (!context.mounted) return;
  await context.fullRefresh(homeownerApiProvider);
}