forked from eatvio/eatvio_app
feat(verify_email): Issue-645
This commit is contained in:
@@ -164,8 +164,12 @@ class ProfileRepository {
|
||||
return (jsonDecode(await profileService.getMyPhone())['phone']);
|
||||
}
|
||||
|
||||
Future<void> sendEmailCode() async {
|
||||
return await profileService.sendEmailCode();
|
||||
Future<void> sendEmailCode({String? newEmail}) async {
|
||||
if (newEmail != null) {
|
||||
return await profileService.sendEmailCode(data: {'new_email': newEmail});
|
||||
} else {
|
||||
return await profileService.sendEmailCode();
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> tryVerifyEmailByCode(String code) async {
|
||||
|
||||
@@ -16,9 +16,7 @@ abstract class ProfileService {
|
||||
factory ProfileService(Dio dio, {String baseUrl}) = _ProfileService;
|
||||
|
||||
@GET('/api/profile/show/{slug}')
|
||||
Future<ProfileModel> getProfileBySlug({
|
||||
@Path() required String slug,
|
||||
});
|
||||
Future<ProfileModel> getProfileBySlug({@Path() required String slug});
|
||||
|
||||
@GET('/api/profile/index')
|
||||
Future<ProfileModel> getMyProfile();
|
||||
@@ -27,9 +25,7 @@ abstract class ProfileService {
|
||||
Future<ProfileDetailsModel> getMyProfileDetails();
|
||||
|
||||
@GET('/api/profile/detailz/{slug}')
|
||||
Future<ProfileDetailsModel> getProfileDetailsBySlug({
|
||||
@Path() required String slug,
|
||||
});
|
||||
Future<ProfileDetailsModel> getProfileDetailsBySlug({@Path() required String slug});
|
||||
|
||||
@POST('/api/profile/addCircumference')
|
||||
Future<void> addCircumference({
|
||||
@@ -39,64 +35,38 @@ abstract class ProfileService {
|
||||
});
|
||||
|
||||
@POST('/api/profile/addWeight')
|
||||
Future<void> addWeight({
|
||||
@Part() required double weight,
|
||||
});
|
||||
Future<void> addWeight({@Part() required double weight});
|
||||
|
||||
@GET('/api/blogPosts/search_by_author/{slug}')
|
||||
Future<List<FeedBlogPostModel>> getBlogPostByAuthorSlug({
|
||||
@Path() required String slug,
|
||||
});
|
||||
Future<List<FeedBlogPostModel>> getBlogPostByAuthorSlug({@Path() required String slug});
|
||||
|
||||
@GET('/api/profile/measure/weight/{period}')
|
||||
Future<List<WeightModel>> getWeight({
|
||||
@Path() required String period,
|
||||
});
|
||||
Future<List<WeightModel>> getWeight({@Path() required String period});
|
||||
|
||||
@GET('/api/profile/measure/weight/{period}/{slug}')
|
||||
Future<List<WeightModel>> getWeightBySlug({
|
||||
@Path() required String period,
|
||||
@Path() required String slug,
|
||||
});
|
||||
Future<List<WeightModel>> getWeightBySlug({@Path() required String period, @Path() required String slug});
|
||||
|
||||
@GET('/api/profile/measure/circumferences/{period}')
|
||||
Future<List<CircumferenceModel>> getCircumferences({
|
||||
@Path() required String period,
|
||||
});
|
||||
Future<List<CircumferenceModel>> getCircumferences({@Path() required String period});
|
||||
|
||||
@GET('/api/profile/measure/circumferences/{period}/{slug}')
|
||||
Future<List<CircumferenceModel>> getCircumferencesBySlug({
|
||||
@Path() required String period,
|
||||
@Path() required String slug,
|
||||
});
|
||||
Future<List<CircumferenceModel>> getCircumferencesBySlug({@Path() required String period, @Path() required String slug});
|
||||
|
||||
@GET('/api/profile/{slug}/subscribers')
|
||||
Future<SubPaginationModel> getSubscribers({
|
||||
@Path() required String slug,
|
||||
@Query('filters[name][\$startsWith]') String? query,
|
||||
});
|
||||
Future<SubPaginationModel> getSubscribers({@Path() required String slug, @Query('filters[name][\$startsWith]') String? query});
|
||||
|
||||
@GET('/api/profile/{slug}/subscriptions')
|
||||
Future<SubPaginationModel> getSubscriptions({
|
||||
@Path() required String slug,
|
||||
@Query('filters[name][\$startsWith]') String? query,
|
||||
});
|
||||
Future<SubPaginationModel> getSubscriptions({@Path() required String slug, @Query('filters[name][\$startsWith]') String? query});
|
||||
|
||||
@POST('/api/profile/subscribe/{slug}')
|
||||
Future<void> subscribe({
|
||||
@Path() required String slug,
|
||||
});
|
||||
Future<void> subscribe({@Path() required String slug});
|
||||
|
||||
@POST('/api/profile/unsubscribe/{slug}')
|
||||
Future<void> unsubscribe({
|
||||
@Path() required String slug,
|
||||
});
|
||||
Future<void> unsubscribe({@Path() required String slug});
|
||||
|
||||
@POST('/api/profile/photo/upload')
|
||||
@MultiPart()
|
||||
Future<void> uploadPhoto({
|
||||
@Part(name: 'photo') required File photo,
|
||||
});
|
||||
Future<void> uploadPhoto({@Part(name: 'photo') required File photo});
|
||||
|
||||
@DELETE('/api/profile/photo/delete')
|
||||
Future<void> deletePhoto();
|
||||
@@ -105,20 +75,16 @@ abstract class ProfileService {
|
||||
Future<ChosenDietsPaginationModel> getChosenDiets();
|
||||
|
||||
@POST('/api/profile/make_pass_key')
|
||||
Future<String> getPassKey({
|
||||
@Body() required String json,
|
||||
});
|
||||
Future<String> getPassKey({@Body() required String json});
|
||||
|
||||
@GET('/api/profile/my_phone')
|
||||
Future<String> getMyPhone();
|
||||
|
||||
@POST('/api/profile/send_email_code')
|
||||
Future<void> sendEmailCode();
|
||||
Future<void> sendEmailCode({@Body() Map<String, dynamic> data = const {}});
|
||||
|
||||
@POST('/api/profile/verificate_email_code')
|
||||
Future<void> tryVerifyEmailByCode({
|
||||
@Body() required String code,
|
||||
});
|
||||
Future<void> tryVerifyEmailByCode({@Body() required String code});
|
||||
|
||||
@DELETE('/api/profile/delete_my_account')
|
||||
Future<void> deleteAccount();
|
||||
|
||||
Reference in New Issue
Block a user