Update login API

This commit is contained in:
Moe Poi ~ 2022-05-12 18:11:20 +07:00
parent 5f9de35fa2
commit 5cd0787a4b

View file

@ -27,13 +27,10 @@ Future<dynamic> registerPost(data) async {
return req.statusCode;
}
Future<dynamic> loginPost({email, password}) async {
Future<dynamic> loginPost(data) async {
Response req = await Dio().post(
('$host/login'),
data: {
'email': email,
'password': password,
},
data: data,
options: Options(
contentType: Headers.formUrlEncodedContentType,
validateStatus: (status) {
@ -41,7 +38,7 @@ Future<dynamic> loginPost({email, password}) async {
},
),
);
return req.statusCode;
return {'statusCode': req.statusCode, 'data': req.data};
}
Future<dynamic> getSessions() async {