Commit 38baf053 authored by Ade Fikriatul  Ilmi's avatar Ade Fikriatul Ilmi

menambahkan get and put per column

parent e430a69a
...@@ -26,11 +26,11 @@ Future<bool> createSosmed (wa, ln, tw, ig, yt) async{ ...@@ -26,11 +26,11 @@ Future<bool> createSosmed (wa, ln, tw, ig, yt) async{
} }
} }
Future<bool> updateSosmed (wa, ln, tw, ig, yt) async { Future<bool> updateSosmed (id, wa, ln, tw, ig, yt) async {
final response = await http final response = await http
.put(Uri.parse('$cmd/settingsosmed/saveSettingSosmed'), .post(Uri.parse('$cmd/settingsosmed/saveSettingSosmed'),
body: jsonEncode({ body: jsonEncode({
// 'idSettingSosmed': id, 'idSettingSosmed': id,
'whatsapp': wa, 'whatsapp': wa,
'linkedin': ln, 'linkedin': ln,
'twitter': tw, 'twitter': tw,
...@@ -53,4 +53,141 @@ Future<List<dynamic>> getSosmedDesc() async { ...@@ -53,4 +53,141 @@ Future<List<dynamic>> getSosmedDesc() async {
//Uri.parse('$qry/settingsosmed/getSettingSosmedById')); //Uri.parse('$qry/settingsosmed/getSettingSosmedById'));
Uri.parse('$qry/settingsosmed/getSettingSosmedByIdDesc')); Uri.parse('$qry/settingsosmed/getSettingSosmedByIdDesc'));
return jsonDecode(response.body)['data']; return jsonDecode(response.body)['data'];
}
Future<bool> createWA (wa) async{
final response = await http.post(
Uri.parse('$cmd/settingsosmed/saveWhatsapp'),
body: jsonEncode(
{
"whatsapp": wa,
// "linkedin": ln,
// "twitter": tw,
// "instagram": ig,
// "youtube": yt,
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<bool> createLN (ln) async{
final response = await http.post(
Uri.parse('$cmd/settingsosmed/saveLinkedin'),
body: jsonEncode(
{
// "whatsapp": wa,
"linkedin": ln,
// "twitter": tw,
// "instagram": ig,
// "youtube": yt,
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<bool> createTW (tw) async{
final response = await http.post(
Uri.parse('$cmd/settingsosmed/saveTwitter'),
body: jsonEncode(
{
// "whatsapp": wa,
// "linkedin": ln,
"twitter": tw,
// "instagram": ig,
// "youtube": yt,
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<bool> createIG (ig) async{
final response = await http.post(
Uri.parse('$cmd/settingsosmed/saveInstagram'),
body: jsonEncode(
{
// "whatsapp": wa,
// "linkedin": ln,
// "twitter": tw,
"instagram": ig,
// "youtube": yt,
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<bool> createYT (yt) async{
final response = await http.post(
Uri.parse('$cmd/settingsosmed/saveYoutube'),
body: jsonEncode(
{
// "whatsapp": wa,
// "linkedin": ln,
// "twitter": tw,
// "instagram": ig,
"youtube": yt,
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<List<dynamic>> getWaDesc() async {
var response = await http.get(
Uri.parse('$qry/settingsosmed/getWhatsappByIdDesc'));
return jsonDecode(response.body)['data'];
}
Future<List<dynamic>> getLnDesc() async {
var response = await http.get(
Uri.parse('$qry/settingsosmed/getLinkedinByIdDesc'));
return jsonDecode(response.body)['data'];
}
Future<List<dynamic>> getTwDesc() async {
var response = await http.get(
Uri.parse('$qry/settingsosmed/getTwitterByIdDesc'));
return jsonDecode(response.body)['data'];
}
Future<List<dynamic>> getIgDesc() async {
var response = await http.get(
Uri.parse('$qry/settingsosmed/getInstagramByIdDesc'));
return jsonDecode(response.body)['data'];
}
Future<List<dynamic>> getYtDesc() async {
var response = await http.get(
Uri.parse('$qry/settingsosmed/getYoutubeByIdDesc'));
return jsonDecode(response.body)['data'];
} }
\ No newline at end of file
...@@ -29,6 +29,7 @@ Future<bool> signUp(namars,nors,alamatrs,namapic,nopic,email, password)async{ ...@@ -29,6 +29,7 @@ Future<bool> signUp(namars,nors,alamatrs,namapic,nopic,email, password)async{
} }
// return response.statusCode; // return response.statusCode;
} }
Future<bool> signIn(username, password)async{ Future<bool> signIn(username, password)async{
final response = await http.post( final response = await http.post(
Uri.parse('$cmd/user/signin'), Uri.parse('$cmd/user/signin'),
......
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