diff --git a/app/src/main/java/es/verdnatura/domain/SalixService.kt b/app/src/main/java/es/verdnatura/domain/SalixService.kt index 8bab2048..9d965955 100644 --- a/app/src/main/java/es/verdnatura/domain/SalixService.kt +++ b/app/src/main/java/es/verdnatura/domain/SalixService.kt @@ -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, ): diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosFragment.kt index fbcc10eb..754395ee 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosFragment.kt @@ -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)) } } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosViewModel.kt index 99c9740b..64288af3 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/photos/fragment/PhotosViewModel.kt @@ -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(context) { override fun onError(t: Throwable) { _responseinsert.value = ResponseItemVO( diff --git a/app/src/main/res/layout/fragment_photos.xml b/app/src/main/res/layout/fragment_photos.xml index 76b3dbab..fc41cfe7 100644 --- a/app/src/main/res/layout/fragment_photos.xml +++ b/app/src/main/res/layout/fragment_photos.xml @@ -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" />