Skip to content

Commit

Permalink
feat: return 200 in case ipfs data is already persisted
Browse files Browse the repository at this point in the history
  • Loading branch information
luzzifoss committed Feb 11, 2024
1 parent 92f0a2e commit 29b236f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/routes/data/ipfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ export const getIPFSDataRoute = async ({
// Check if data is already on IPFS
try {
await w3UpClient.capability.store.get(parsedCid);
throw new Error(
`Data with CID ${cid} already existing on IPFS`,
);
return h.response({ cid }).code(200).type("application/json");
} catch (error: any) {
if (error.cause && error.cause.name === "StoreItemNotFound")
request.logger.info("Data not existing on IPFS yet");
Expand Down

0 comments on commit 29b236f

Please sign in to comment.