refs #5322 NaturePhotos
This commit is contained in:
parent
6db09cd73a
commit
307a53849b
|
@ -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,
|
||||
):
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue