From 63f275776db9caa626fd8e117f521851a1e0ba44 Mon Sep 17 00:00:00 2001 From: Matthew Patrick Date: Wed, 27 Apr 2022 01:13:53 +0700 Subject: [PATCH] Modified Register API to take just 1 JSON object --- lib/api/api.dart | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/api/api.dart b/lib/api/api.dart index a6f62b1..d7d94d8 100644 --- a/lib/api/api.dart +++ b/lib/api/api.dart @@ -13,15 +13,10 @@ Future getProduct(id) async { return res; } -Future registerPost({email, password, firstName, lastName}) async { +Future registerPost(data) async { Response req = await Dio().post( (host + '/register'), - data: { - 'email': email, - 'password': password, - 'first_name': firstName, - 'last_name': lastName - }, + data: data, options: Options( contentType: Headers.formUrlEncodedContentType, validateStatus: (status) {