Skip to content
Snippets Groups Projects
Commit c4ad99fd authored by Louis's avatar Louis :fire:
Browse files

Pull feed from the last month

parent dc0ae3f6
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ const HttpError = require('core/errors/HttpError')
const mimeType = require('mime-types')
const uuid = require('uuid/v4')
const { fs, env } = require('bootstrap')
const moment = require('moment')
const storage = new Storage({ keyFilename: fs.path('google-storage.json') })
......@@ -87,6 +88,9 @@ exports.feed = async ctx => {
feed: (await File.findAll({
where: {
approved: true,
created_at: {
[Sequelize.Op.gt]: moment.utc().subtract(1, 'month').toISOString(),
},
},
order: [['created_at', 'desc']],
attributes: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment