Fix: Drop Publish returned wrong status code if not found

Deleting a publish that does not exist now results in a status code 404
instead of 500.

Fixes: #1006
This commit is contained in:
Mauro Regli
2023-03-07 13:13:34 +01:00
committed by Benj Fassbind
parent c187b0d52c
commit dbf1ac7867

View File

@@ -376,7 +376,7 @@ func apiPublishDrop(c *gin.Context) {
published, err := collection.ByStoragePrefixDistribution(storage, prefix, distribution)
if err != nil {
AbortWithJSONError(c, http.StatusInternalServerError, fmt.Errorf("unable to drop: %s", err))
AbortWithJSONError(c, http.StatusNotFound, fmt.Errorf("unable to drop: %s", err))
return
}