diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index 05399457..531cf589 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -12,9 +12,7 @@ import 'package:eatvio_app/features/profile/services/profile_service.dart'; class ProfileRepository { final ProfileService profileService; - ProfileRepository({ - required this.profileService, - }); + ProfileRepository({required this.profileService}); Future getProfileBySlug(String slug) async { try { @@ -48,11 +46,7 @@ class ProfileRepository { } } - Future addCircumference({ - required int chestCircumference, - required int waistCircumference, - required int hipCircumference, - }) async { + Future addCircumference({required int chestCircumference, required int waistCircumference, required int hipCircumference}) async { try { return (await profileService.addCircumference( chestCircumference: chestCircumference, @@ -64,9 +58,7 @@ class ProfileRepository { } } - Future addWeight({ - required double weight, - }) async { + Future addWeight({required double weight}) async { try { return (await profileService.addWeight(weight: weight)); } catch (e) { @@ -74,52 +66,32 @@ class ProfileRepository { } } - Future> getBlogPostsByAuthorSlug({ - required String slug, - }) async { + Future> getBlogPostsByAuthorSlug({required String slug}) async { try { - return (await profileService.getBlogPostByAuthorSlug( - slug: slug, - )); + return (await profileService.getBlogPostByAuthorSlug(slug: slug)); } catch (e) { rethrow; } } - Future> getWeight({ - required String period, - String? slug, - }) async { + Future> getWeight({required String period, String? slug}) async { try { if (slug != null) { - return (await profileService.getWeightBySlug( - period: period, - slug: slug, - )); + return (await profileService.getWeightBySlug(period: period, slug: slug)); } else { - return (await profileService.getWeight( - period: period, - )); + return (await profileService.getWeight(period: period)); } } catch (e) { rethrow; } } - Future> getCircumferences({ - required String period, - String? slug, - }) async { + Future> getCircumferences({required String period, String? slug}) async { try { if (slug != null) { - return (await profileService.getCircumferencesBySlug( - period: period, - slug: slug, - )); + return (await profileService.getCircumferencesBySlug(period: period, slug: slug)); } else { - return (await profileService.getCircumferences( - period: period, - )); + return (await profileService.getCircumferences(period: period)); } } catch (e) { rethrow; @@ -184,7 +156,8 @@ class ProfileRepository { Future getPassKey(String phone) async { return (jsonDecode( - (await profileService.getPassKey(json: '{"route_name": "user_detailz.change-phone-verify", "route_params": {"phone": "$phone"}}'))))['key_is']!; + (await profileService.getPassKey(json: '{"route_name": "user_detailz.change-phone-verify", "route_params": {"phone": "$phone"}}')), + ))['key_is']!; } Future getMyPhone() async { @@ -206,7 +179,7 @@ class ProfileRepository { Future deleteAccount() async { try { - await profileService.deleteAccount(); + await profileService.deleteAccount(); } catch (e) { rethrow; } diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index a1208526..bddd46f8 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -64,7 +64,7 @@ abstract class ProfileService { @Path() required String period, }); - @GET('/api/profile/measure/circumferences/{period}/{user}') + @GET('/api/profile/measure/circumferences/{period}/{slug}') Future> getCircumferencesBySlug({ @Path() required String period, @Path() required String slug,