refs #5322 NaturePhotos

This commit is contained in:
Sergio De la torre 2023-06-02 14:50:25 +02:00
parent 6db09cd73a
commit 307a53849b
4 changed files with 9 additions and 5 deletions

View File

@ -156,8 +156,8 @@ interface SalixService {
@POST("Images/upload")
@Multipart
fun uploadImage(
@Part ("collection") collection: String,
@Query("filter") filter: String,
@Query ("collection") collection: String,
//@Query("fileName") file: String,
@Query("id") id: Int,
@Part filePart: MultipartBody.Part,
):

View File

@ -50,7 +50,7 @@
binding.splashProgress.visibility = GONE
setEvents()
setToolBar()
loadImage()
upLoadPhoto()
super.init()
}
@ -137,10 +137,13 @@
}
private fun upLoadPhoto() {
println("llamada")
val drawable = binding.userImage.drawable
if (drawable is BitmapDrawable) {
val bitmap = drawable.bitmap
viewModel.uploadPhoto(saveBitmapAsTempFile(requireContext(),bitmap))
}
}

View File

@ -43,7 +43,7 @@ class PhotosViewModel(val context: Context) : BaseViewModel(context) {
) {
salix.uploadImage("catalog",fileName,itemFK,filePart)
salix.uploadImage("catalog",itemFK,filePart)
.enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseinsert.value = ResponseItemVO(

View File

@ -33,7 +33,8 @@
android:layout_height="@dimen/itemcard_image_height"
android:layout_margin="10dp"
android:scaleType="centerCrop"
android:src="@drawable/loadphoto" />
android:src="@drawable/camion"
app:srcCompat="@drawable/alpha_b_circle_outline" />
<LinearLayout
android:layout_width="match_parent"