From 5cd0787a4bd9522654a50bedcca2cb92795a4170 Mon Sep 17 00:00:00 2001 From: Moe Date: Thu, 12 May 2022 18:11:20 +0700 Subject: [PATCH] Update login API --- lib/api/api.dart | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/api/api.dart b/lib/api/api.dart index aa3df41..03e6710 100644 --- a/lib/api/api.dart +++ b/lib/api/api.dart @@ -27,13 +27,10 @@ Future registerPost(data) async { return req.statusCode; } -Future loginPost({email, password}) async { +Future 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 loginPost({email, password}) async { }, ), ); - return req.statusCode; + return {'statusCode': req.statusCode, 'data': req.data}; } Future getSessions() async {