remove usage of user type

This commit is contained in:
2026-04-15 08:40:55 +02:00
parent c855503edd
commit 379633d7f5

View File

@@ -1,3 +1,4 @@
import 'package:ken_logger/ken_logger.dart';
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart'; import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
import 'package:mzansi_innovation_hub/mih_objects/business.dart'; import 'package:mzansi_innovation_hub/mih_objects/business.dart';
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart'; import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
@@ -23,12 +24,11 @@ class MihDataHelperServices {
} }
Future<void> getBusinessData(MzansiProfileProvider profileProvider) async { Future<void> getBusinessData(MzansiProfileProvider profileProvider) async {
AppUser? user = profileProvider.user;
String logoUrl; String logoUrl;
String signatureUrl; String signatureUrl;
Business? responseBusiness = await MihBusinessDetailsServices() Business? responseBusiness = await MihBusinessDetailsServices()
.getBusinessDetailsByUser(profileProvider); .getBusinessDetailsByUser(profileProvider);
if (responseBusiness != null && user!.type == "business") { if (responseBusiness != null) {
logoUrl = await MihFileApi.getMinioFileUrl( logoUrl = await MihFileApi.getMinioFileUrl(
profileProvider.business!.logo_path, profileProvider.business!.logo_path,
); );
@@ -58,9 +58,7 @@ class MihDataHelperServices {
if (profileProvider.userConsent == null) { if (profileProvider.userConsent == null) {
await getUserConsentStatus(profileProvider); await getUserConsentStatus(profileProvider);
} }
if (profileProvider.user != null && if (profileProvider.user != null && profileProvider.business == null) {
profileProvider.user!.type == "business" &&
profileProvider.business == null) {
await getBusinessData(profileProvider); await getBusinessData(profileProvider);
} }
} }