step 12 : add userId di home dan proses upload file
This commit is contained in:
@@ -6,10 +6,13 @@ class ScanRepository extends BaseRepository {
|
||||
|
||||
Future<List<PersonKtp>> listRiwayatScanRepo({
|
||||
required String host,
|
||||
required String userId,
|
||||
}) async {
|
||||
// final service = "${Constant.baseUrl}xauth/login";
|
||||
final service = "http://${host}/one-api/scan-ktp/Scanktp/listRiwayatScan";
|
||||
final resp = await post(param: {}, service: service);
|
||||
final resp = await post(param: {
|
||||
"userId":userId
|
||||
}, service: service);
|
||||
|
||||
final result = List<PersonKtp>.empty(growable: true);
|
||||
resp['data'].forEach((e) {
|
||||
@@ -23,15 +26,17 @@ class ScanRepository extends BaseRepository {
|
||||
Future<String> prosesScan({
|
||||
required String host,
|
||||
required String base64File,
|
||||
required String userId,
|
||||
}) async {
|
||||
final service = "http://${host}/one-api/scan-ktp/Scanktp/proses_scan";
|
||||
final resp = await post(param:{
|
||||
"base64File":base64File
|
||||
final resp = await post(param: {
|
||||
"base64File": base64File,
|
||||
"userId": userId,
|
||||
}, service: service);
|
||||
|
||||
if(resp['status'] == "OK"){
|
||||
if (resp['status'] == "OK") {
|
||||
return "Sukses Upload File";
|
||||
}else{
|
||||
} else {
|
||||
resp['message'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user