Skip to content

Commit

Permalink
fix: allow delete when newspaper does not exist in catalogue (TT-1737) (
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikmonsen authored Oct 30, 2024
1 parent 643c3e1 commit 5f2a6b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/services/catalog.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ export async function deletePhysicalItemFromCatalog(catalog_id: string, deleteMa
.then(async response => {
if (response.ok) {
return Promise.resolve();
} else if (response.status === 404) {
// If the item does not exist in the catalogue then we can consider it deleted
return Promise.resolve();
} else {
return Promise.reject(new Error(`Failed to delete item in catalog: ${response.status} - ${await response.json()}`));
}
Expand Down

0 comments on commit 5f2a6b2

Please sign in to comment.