mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 18:04:54 +00:00
Added Login with email model instead of json encode
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:syncrow_app/features/auth/model/login_with_email_model.dart';
|
||||
import 'package:syncrow_app/features/auth/model/token.dart';
|
||||
import 'package:syncrow_app/features/auth/model/verify_code.dart';
|
||||
import 'package:syncrow_app/services/api/api_links_endpoints.dart';
|
||||
@ -20,13 +19,10 @@ class AuthenticationAPI {
|
||||
}
|
||||
|
||||
static Future<Token> loginWithEmail(
|
||||
{required String email, required String password}) async {
|
||||
{required LoginWithEmailModel model}) async {
|
||||
final response = await HTTPService().post(
|
||||
path: ApiEndpoints.login,
|
||||
body: jsonEncode({
|
||||
"email": email,
|
||||
"password": password,
|
||||
}),
|
||||
body: model.toJson(),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
Token token = Token.fromJson(json['data']);
|
||||
|
||||
Reference in New Issue
Block a user