summaryrefslogtreecommitdiff
path: root/lib/db
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-06-30 20:17:24 +0200
committerJules Laplace <julescarbon@gmail.com>2017-06-30 20:17:24 +0200
commit7c5ca9fdcafcec0e3781ed856eba42cd608f0e15 (patch)
treea4425e8ce03538c1741e6c10b0a2459bcb03aea2 /lib/db
parent82cf40b516b5ab11c34b3642a01603ec1b590c9f (diff)
es6 stuff
Diffstat (limited to 'lib/db')
-rw-r--r--lib/db/index.js23
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/db/index.js b/lib/db/index.js
index 468d9be..a74ba89 100644
--- a/lib/db/index.js
+++ b/lib/db/index.js
@@ -54,26 +54,3 @@ db.crud = function(type, model) {
},
}
}
-db.getFolders = function(id) {
- var model = new Folder({'id': id})
- return model.fetch()
-}
-db.getFolderFiles = function(id) {
- return File.query(function(qb){
- qb.where('folder_id', '=', id).orderBy("id", "desc")
- }).fetch()
-}
-db.getLatest = function () {
- return Image.query(function(qb){
- qb.orderBy("id", "desc").limit(1)
- }).fetch()
-}
-db.getRandom = function () {
- return Image.query(function(qb){
- qb.orderBy(knex.raw('RAND()')).limit(1)
- }).fetch()
-}
-
-db.createImage = function(url){
- return new Image({ url: url, shorturl: "" }).save()
-} \ No newline at end of file