aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes/files/filesGET.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2018-09-17 04:55:42 -0300
committerPitu <[email protected]>2018-09-17 04:55:42 -0300
commitf2c885b718528d42df412e612520fb471c46d0bd (patch)
tree8841d063055b6a3ce9abdbd1e3482d8557996f4f /src/api/routes/files/filesGET.js
parentChanges (diff)
downloadhost.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.js8
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