added api for forgot password

This commit is contained in:
llsajjad
2025-09-16 15:51:56 +03:30
parent 09ac79fd79
commit 69980925ad
13 changed files with 886 additions and 130 deletions
+16
View File
@@ -5,6 +5,7 @@ import 'dart:convert';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tm_app/core/utils/logger.dart';
import 'package:tm_app/data/services/api/auth_api.dart';
import 'package:tm_app/data/services/model/forgot_password_response/forgot_password_response_model.dart';
import 'package:tm_app/data/services/model/login_response/login_response_model.dart';
import 'package:tm_app/data/services/model/logout_response/logout_response.dart';
@@ -56,4 +57,19 @@ class AuthService {
await prefs.remove('refresh_token');
appLogger.info('tokens cleared!');
}
Future<Result<ForgotPasswordResponseModel>> forgotPassword({
required String email,
}) async {
final data = jsonEncode({"email": email});
final result = await _networkManager.makeRequest(
AuthApi.forgotPassword,
method: 'POST',
(json) => ForgotPasswordResponseModel.fromJson(json),
data: data,
);
return result;
}
}