forked from thijooree/android
delete and transfer contacts
This commit is contained in:
@@ -182,6 +182,19 @@ class MibContactsClient {
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteContact(session: MibSession, benefNo: String): Boolean {
|
||||
val body = FormBody.Builder().add("benefNo", benefNo).build()
|
||||
val request = Request.Builder()
|
||||
.url("$BASE_WV_URL/ajaxBeneficiary/deleteBeneficiary")
|
||||
.post(body)
|
||||
.withSessionHeaders(session)
|
||||
.build()
|
||||
return client.newCall(request).execute().use { response ->
|
||||
val bodyStr = response.body?.string() ?: return@use false
|
||||
try { JSONObject(bodyStr).optBoolean("success") } catch (_: Exception) { false }
|
||||
}
|
||||
}
|
||||
|
||||
fun fetchProfileImageBase64(session: MibSession, imageHash: String): String? {
|
||||
val body = FormBody.Builder()
|
||||
.add("imageHash", imageHash)
|
||||
|
||||
Reference in New Issue
Block a user