Inhalte aufrufen

Profilbild

WebApi: Delete ProductImages

webapi productimages

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
10 Antworten zu diesem Thema

#1 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 16 January 2020 - 14:06

So i can succesfully upload images to products but i was wondering how would one delete a product picture? 

This document only describes uploading: https://docs.smartst... Product Images

 

And what would be the way to upload images for categories?



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 16 January 2020 - 14:30

Deleting product pictures is not implemented. I added an issue for it.
It's only possible to upload product images using the Web API.

Marcus Gesing

Smartstore AG


#3 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 16 January 2020 - 14:48

Well that explains why i could find it  ;)

 

Is there also an endpoint for uploading categorie and manufacturer images? If not, while you at it at Github issue please add it to the Implement list  :)

 

Edit:

Could you give a estimation when this will be available? We are planning to go live this month so it would be very help full if this is implemented.



#4 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 17 January 2020 - 14:47

Thinking outside the box: If i delete the Picture object at endpoint odata/v1/Pictures will this cause removal of the image? (Images are stored at filebase)



#5 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 17 January 2020 - 15:09

Yes but the picture id assigned to attribute combinations is not removed, if there are any.


Marcus Gesing

Smartstore AG


#6 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 17 January 2020 - 15:23

Oké that could be a temp workarround for me to delete ProductPictures if needed while the issue isn't released.

 

I did a GET /odata/v1/Products in Swagger but it didn't returned property collection ProductPictures but there are images assigned to the product? I need this list because i can then check which images with MediaID X i have to delete that matched the ProductPictures.



#7 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 17 January 2020 - 15:27

Try
GET /odata/v1/Products(product-id)/ProductPictures?$top=100

Marcus Gesing

Smartstore AG


#8 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 23 January 2020 - 15:48

I did a GET /odata/v1/Products()?$top=120&$expand=ProductPictures this gives me all the pictures that are tagged with this product. I now try to find the picture by comparing ProductPicture.PictureID with the Picture.ID of endpoint /odata/v1/Pictures but this doesn't gives me a match so i cannot call DELETE /odata/v1/Pictures(XX)

 

Just to be sure if i call DELETE /odata/v1/Products(XX) does this also removes the productpictures?



#9 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 23 January 2020 - 21:32

No. A product is a primary entity which is marked as deleted and not physically deleted in database, means above delete call has no effect on product pictures.


Marcus Gesing

Smartstore AG


#10 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 27 January 2020 - 12:01

Is het dan nog nodig dat wanneer je een product "Delete" om de product foto's te verwijderen?



#11 stefanmueller

stefanmueller

    SmartStore AG

  • Administrators
  • 452 Beiträge

Geschrieben: 15 February 2021 - 09:52

Deleting a picture via Web API seems to work now, issue 1792 has been closed in Jan 2020.

 

"make IProductService.DeleteProductPicture accessible"

https://github.com/s...NET/issues/1792


Stefan



Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: webapi, productimages