improve dashboard

This commit is contained in:
tdurieux
2021-03-23 08:39:28 +01:00
parent 3f083d451d
commit 83dd070843
4 changed files with 38 additions and 12 deletions
+2 -1
View File
@@ -152,7 +152,8 @@ router.delete("/:repoId/", async (req, res) => {
try {
await repoUtils.updateStatus(repoConfig, "removed");
await repoUtils.removeRepository(repoConfig);
return res.send("ok");
console.log(`${req.params.repoId} is removed`);
return res.json("ok");
} catch (error) {
return res.status(500).json({ error });
}
+1 -4
View File
@@ -43,9 +43,6 @@ router.get("/anonymized_repositories", async (req, res) => {
) {
await repoUtils.updateStatus({ repoId: repo.repoId }, "expired");
repo.status = "expired";
} else {
await repoUtils.updateStatus({ repoId: repo.repoId }, "ready");
repo.status = "ready";
}
}
res.json(repos);
@@ -60,7 +57,7 @@ router.get("/all_repositories", async (req, res) => {
{ projection: { repositories: 1 } }
);
if (!user) {
res.status(401).send({error: "user_not_found"});
res.status(401).send({ error: "user_not_found" });
}
if (user.repositories && req.query.force !== "1") {
return res.json(user.repositories);