Skip to content

Commit 16e3595

Browse files
committed
fixed deletion of legacy groups/artifacts
1 parent d103bab commit 16e3595

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

server/app/api/routes/artifact.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,15 @@ module.exports = function (router, protector) {
101101
var result = await GstoreHelper.delete(req.params.account, gstorePath);
102102

103103
if (!result.isSuccess) {
104-
res.status(result.error.status).send(`Failed to delete artifact <${artifactUri}>: ${result.error.message}`);
105-
return;
104+
105+
gstorePath = `${req.params.group}/${req.params.artifact}/artifact.jsonld`;
106+
result = await GstoreHelper.delete(req.params.account, gstorePath);
107+
108+
if (!result.isSuccess) {
109+
res.status(result.error.status).send(`Failed to delete artifact <${artifactUri}>: ${result.error.message}`);
110+
return;
111+
}
112+
106113
}
107114

108115
res.status(204).send(`The artifact <${artifactUri}> has been deleted.`);

server/app/api/routes/group.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,15 @@ module.exports = function (router, protector) {
9999
var result = await GstoreHelper.delete(req.params.account, gstorePath);
100100

101101
if (!result.isSuccess) {
102-
res.status(500).send(`Internal database error. Failed to delete the group <${groupUri}>.`);
103-
return;
102+
103+
gstorePath = `${req.params.group}/group.jsonld`;
104+
result = await GstoreHelper.delete(req.params.account, gstorePath);
105+
106+
if (!result.isSuccess) {
107+
res.status(500).send(`Internal database error. Failed to delete the group <${groupUri}>.`);
108+
return;
109+
}
110+
104111
}
105112

106113
res.status(204).send(`The group <${groupUri}> has been deleted.`);

0 commit comments

Comments
 (0)