From 11e00d3f9814663598982345cdc18b2445b697a5 Mon Sep 17 00:00:00 2001 From: MohammadTaha Basiri Date: Sat, 8 Jan 2022 14:17:40 +0330 Subject: [PATCH] D1APP-22 new apis + type correction --- lib/services/network/request.dart | 4 ++-- lib/services/network/request_helper.dart | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/services/network/request.dart b/lib/services/network/request.dart index dc23f9b..346dcb2 100644 --- a/lib/services/network/request.dart +++ b/lib/services/network/request.dart @@ -8,8 +8,8 @@ class RequestService { static set token(String value) => _token = value; - Map get result => _body['result'] ?? const {}; - Map get errors => _body['errors'] ?? const {}; + Map get result => _body['result'] ?? const {}; + Map get errors => _body['errors'] ?? const {}; String errorMessage = 'خطا! لطفا اتصال اینترنت خود را بررسی و مجددا تلاش نمایید.'; diff --git a/lib/services/network/request_helper.dart b/lib/services/network/request_helper.dart index c0d37fc..a14df9c 100644 --- a/lib/services/network/request_helper.dart +++ b/lib/services/network/request_helper.dart @@ -1,9 +1,17 @@ class RequestHelper { static const String _baseUrl = 'https://didvan-greatsam.fandogh.cloud'; + static const String _baseUserUrl = _baseUrl + '/user'; - static const String confirmUsername = _baseUrl + '/user/confirmUsername'; - static const String login = _baseUrl + '/user/login'; + static const String confirmUsername = _baseUserUrl + '/confirmUsername'; + static const String login = _baseUserUrl + '/login'; + static const String directs = _baseUserUrl + '/direct'; + static const String userInfo = _baseUserUrl + '/info'; + static const String updateUserProfile = _baseUserUrl + '/profile/photo'; + static const String updateUsername = _baseUserUrl + '/setUsername'; + static const String radarCategories = _baseUrl + '/category'; + + static String direct(int id) => _baseUserUrl + '/direct/$id'; static String getRadarOverviews({ required int page, List categories = const [],