mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
dio and login functions
This commit is contained in:
@ -1 +1,29 @@
|
||||
class AuthAPI {}
|
||||
import 'package:syncrow_web/pages/auth/model/token.dart';
|
||||
import 'api/api_links_endpoints.dart';
|
||||
import 'api/http_service.dart';
|
||||
|
||||
class AuthenticationAPI {
|
||||
|
||||
|
||||
static Future<Token> loginWithEmail({required var model}) async {
|
||||
final response = await HTTPService().post(
|
||||
path: ApiEndpoints.login,
|
||||
body: model.toJson(),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) => Token.fromJson(json['data']));
|
||||
return response;
|
||||
}
|
||||
|
||||
// static Future<bool> signUp({required SignUpModel model}) async {
|
||||
// final response = await HTTPService().post(
|
||||
// path: ApiEndpoints.signUp,
|
||||
// body: model.toJson(),
|
||||
// showServerMessage: false,
|
||||
// expectedResponseModel: (json) => json['statusCode'] == 201);
|
||||
// return response;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user