diff options
| author | Pitu <[email protected]> | 2018-09-17 04:55:42 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2018-09-17 04:55:42 -0300 |
| commit | f2c885b718528d42df412e612520fb471c46d0bd (patch) | |
| tree | 8841d063055b6a3ce9abdbd1e3482d8557996f4f /src/api/routes/files/filesGET.js | |
| parent | Changes (diff) | |
| download | host.fuwn.me-f2c885b718528d42df412e612520fb471c46d0bd.tar.xz host.fuwn.me-f2c885b718528d42df412e612520fb471c46d0bd.zip | |
Commented all the code
Diffstat (limited to 'src/api/routes/files/filesGET.js')
| -rw-r--r-- | src/api/routes/files/filesGET.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/api/routes/files/filesGET.js b/src/api/routes/files/filesGET.js index 98cf3aa..d1b6619 100644 --- a/src/api/routes/files/filesGET.js +++ b/src/api/routes/files/filesGET.js @@ -9,12 +9,20 @@ class filesGET extends Route { } async run(req, res, user) { + /* + Get all the files from the user + */ const files = await db.table('files') .where('userId', user.id) .orderBy('id', 'desc'); + + /* + For each file, create the public link to be able to display the file + */ for (let file of files) { file = Util.constructFilePublicLink(file); } + return res.json({ message: 'Successfully retrieved files', files |