Commit 44bae067 authored by Tohap Maruli Pasaribu's avatar Tohap Maruli Pasaribu

update data on Action="Edit" in Data User

parent 752af512
...@@ -11,6 +11,29 @@ Future<List<dynamic>> getUserControl() async { ...@@ -11,6 +11,29 @@ Future<List<dynamic>> getUserControl() async {
return jsonDecode(response.body)['data']; return jsonDecode(response.body)['data'];
} }
Future<bool> editUserControl(idUser, namaRs, noRs, alamatRs, namaPic, noPic,
emailPic, password, statusUser) async {
final response = await http.post(Uri.parse('$cmd/user/signup'),
body: jsonEncode({
"idUser": idUser,
"namaRs": namaRs,
"noRs": noRs,
"alamatRs": alamatRs,
"namaPic": namaPic,
"noPic": noPic,
"emailPic": emailPic,
"password": password,
"statusUser": statusUser
}),
headers: {'Content-type': 'application/json; charset=UTF-8'});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<bool> deleteUserControl(idUser) async { Future<bool> deleteUserControl(idUser) async {
final response = await http.post(Uri.parse('$cmd/user/updateUser'), final response = await http.post(Uri.parse('$cmd/user/updateUser'),
body: jsonEncode({"idUser": idUser}), body: jsonEncode({"idUser": idUser}),
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment