Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Implement /api/tmp-do-not-ship-set-all-indefinite
Browse files Browse the repository at this point in the history
This is to help QA set their shots to indefinite expiration, even though the frontend of the website has removed that functionality.
  • Loading branch information
ianb committed Jan 16, 2019
1 parent 929ac42 commit cbddd7c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,18 @@ app.post("/api/set-expiration", function(req, res) {
});
});

app.get("/api/tmp-do-not-ship-set-all-indefinite", async function(req, res) {
if (!(req.deviceId || req.accountId)) {
simpleResponse(res, "Not logged in", 401);
return;
}
const { shots } = await Shot.getShotsForDevice(req.backend, req.deviceId, req.accountId, null, 0);
for (const shot of shots) {
await Shot.setExpiration(req.backend, shot.id, req.deviceId, 0, req.accountId);
}
simpleResponse(res, "Some shots set to indefinite", 200);
});

app.get("/images/:imageid", function(req, res) {
const embedded = req.query.embedded;
const download = req.query.download;
Expand Down

0 comments on commit cbddd7c

Please sign in to comment.