diff options
| author | Pitu <[email protected]> | 2018-09-16 17:52:46 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2018-09-16 17:52:46 -0300 |
| commit | e073fb4317ae8bd55dfcd0531de10e67383aa408 (patch) | |
| tree | d5b4c379019b1845f81328a46ddfb722ec72dbc4 /src/api | |
| parent | Links are managed elsewhere, so there's no point in this (diff) | |
| download | host.fuwn.me-e073fb4317ae8bd55dfcd0531de10e67383aa408.tar.xz host.fuwn.me-e073fb4317ae8bd55dfcd0531de10e67383aa408.zip | |
Links can now be created
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/routes/albums/link/linkPOST.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/api/routes/albums/link/linkPOST.js b/src/api/routes/albums/link/linkPOST.js index e8f3731..26a527a 100644 --- a/src/api/routes/albums/link/linkPOST.js +++ b/src/api/routes/albums/link/linkPOST.js @@ -11,22 +11,22 @@ class linkPOST extends Route { async run(req, res) { if (!req.body) return res.status(400).json({ message: 'No body provided' }); - const { albumId, enabled, enableDownload, expiresAt } = req.body; + const { albumId } = req.body; if (!albumId) return res.status(400).json({ message: 'No album provided' }); const exists = await db.table('albums').where('id', albumId).first(); if (!exists) return res.status(400).json({ message: 'Album doesn\t exist' }); - const identifier = Util.getUniqueAlbumIdentifier(); + const identifier = await Util.getUniqueAlbumIdentifier(); if (!identifier) return res.status(500).json({ message: 'There was a problem allocating a link for your album' }); try { await db.table('links').insert({ identifier, albumId, - enabled, - enableDownload, - expiresAt + enabled: true, + enableDownload: true, + expiresAt: null }); return res.json({ |