Skip to content

Commit

Permalink
update dep's; refactor metadata to reload crate if there are errors
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolarosa committed Oct 18, 2023
1 parent 1dcc22a commit 435e3ab
Show file tree
Hide file tree
Showing 4 changed files with 920 additions and 833 deletions.
8 changes: 8 additions & 0 deletions api/src/routes/describo.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,16 @@ async function postCopyCrateHandler(req) {
// TODO: this code does not have tests
async function getDescriboROCrate(req) {
const { type, identifier } = req.params;

let store = await getStoreHandle({ id: identifier, type });

if (req.query.reset === "true") {
await store.put({
target: "ro-crate-metadata.json",
json: createDefaultROCrateFile({ name: identifier }),
});
}

let crate, filesAdded;
try {
crate = await store.getJSON({ target: "ro-crate-metadata.json" });
Expand Down
Loading

0 comments on commit 435e3ab

Please # to comment.