updateMyProfile method

Future<Map<String, dynamic>> updateMyProfile({
  1. String? firstName,
  2. String? lastName,
  3. String? language,
  4. String? location,
  5. String? email,
  6. String? username,
  7. String? profilePhotoPath,
})

Update my profile

Implementation

Future<Map<String, dynamic>> updateMyProfile({
  String? firstName,
  String? lastName,
  String? language,
  String? location,
  String? email,
  String? username,
  String? profilePhotoPath,
}) async {
  final userId = await getSavedUserId();
  final tenantId = await getTenantId();

  if (userId == null || tenantId == null) {
    return {
      'success': false,
      'message': 'User not logged in or missing credentials',
    };
  }

  return await updateUserProfile(
    userId: userId,
    tenantId: tenantId,
    firstName: firstName,
    lastName: lastName,
    language: language,
    location: location,
    email: email,
    username: username,
    profilePhotoPath: profilePhotoPath,
  );
}