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; return req.statusCode;
} }
Future<dynamic> loginPost({email, password}) async { Future<dynamic> loginPost(data) async {
Response req = await Dio().post( Response req = await Dio().post(
('$host/login'), ('$host/login'),
data: { data: data,
'email': email,
'password': password,
},
options: Options( options: Options(
contentType: Headers.formUrlEncodedContentType, contentType: Headers.formUrlEncodedContentType,
validateStatus: (status) { 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 { Future<dynamic> getSessions() async {