step 12 : proses edit rekaman
This commit is contained in:
@@ -14,7 +14,7 @@ class VoiceToTextRepository extends BaseRepository {
|
||||
}) async {
|
||||
// final service = "${Constant.baseUrl}xauth/login";
|
||||
final service =
|
||||
"http://${host}/one-api/scan-ktp/Voicetotext/listRiwayatRekaman";
|
||||
"http://${host}/one-api/voice_2text/Voicetotext/listRiwayatRekaman";
|
||||
final resp = await post(param: {"userId": userId}, service: service);
|
||||
|
||||
final result = List<VoiceToTextModel>.empty(growable: true);
|
||||
@@ -34,7 +34,8 @@ class VoiceToTextRepository extends BaseRepository {
|
||||
required String qrCodeStr,
|
||||
}) async {
|
||||
// final service = "${Constant.baseUrl}xauth/login";
|
||||
final service = "http://${host}/one-api/scan-ktp/Voicetotext/uploadRekaman";
|
||||
final service =
|
||||
"http://${host}/one-api/voice_2text/Voicetotext/uploadRekaman";
|
||||
|
||||
FormData formData = FormData.fromMap({
|
||||
"audio": await MultipartFile.fromFile(
|
||||
@@ -42,7 +43,7 @@ class VoiceToTextRepository extends BaseRepository {
|
||||
filename: "rekaman.mp3",
|
||||
),
|
||||
"userId": userId,
|
||||
"qrCodeStr":qrCodeStr,
|
||||
"qrCodeStr": qrCodeStr,
|
||||
});
|
||||
|
||||
final resp = await postAudio(
|
||||
@@ -58,4 +59,30 @@ class VoiceToTextRepository extends BaseRepository {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// edit
|
||||
Future<String> prosesEdit({
|
||||
required String host,
|
||||
required String Voice2text_ID,
|
||||
required String Voice2text_Note,
|
||||
required String Voice2text_Text,
|
||||
}) async {
|
||||
final service = "http://${host}/one-api/voice_2text/Voicetotext/editRekaman";
|
||||
final resp = await post(
|
||||
param: {
|
||||
"Voice2text_ID": Voice2text_ID,
|
||||
"Voice2text_Note": Voice2text_Note,
|
||||
"Voice2text_Text": Voice2text_Text,
|
||||
},
|
||||
service: service,
|
||||
);
|
||||
|
||||
if (resp['status'] == "OK") {
|
||||
return "Sukses Update Data";
|
||||
} else {
|
||||
resp['message'];
|
||||
}
|
||||
|
||||
return resp['message'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user