mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-21 00:44:47 +02:00
improve dashboard
This commit is contained in:
+2
-1
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user