diff --git a/src/libs/middlewares/oauth2.js b/src/libs/middlewares/oauth2.js index 5d8ba39f4b9187edeb10ed7eaa6930e68562fdac..f5f4b658a4146276b5e06cd1849aa336f687043e 100644 --- a/src/libs/middlewares/oauth2.js +++ b/src/libs/middlewares/oauth2.js @@ -16,7 +16,6 @@ const origin_to_secret = { 'LDE': 'LDE' }; - // create OAuth 2.0 server let aserver = oauth2orize.createServer() diff --git a/src/libs/models/publication.js b/src/libs/models/publication.js index b750f95e8c50ebc1f2bbd520cd0fc36fcb71bd66..5ce34d4765b75d6060fc9577e30479d83e21ad73 100644 --- a/src/libs/models/publication.js +++ b/src/libs/models/publication.js @@ -62,9 +62,7 @@ var Publication = db.define("Publication",{ allowNull: false, defaultValue: false } - -}, -{timestamps: false}); +}); Publication.generateObjectId = function(){ var timestamp = (new Date().getTime() / 1000 | 0).toString(16); diff --git a/src/libs/routes_v1/activity.js b/src/libs/routes_v1/activity.js index bec695006a90065539566198e60f38aab42c4e38..51ef67ea1ae60d35636dc42f3770f62b0fd9b29b 100644 --- a/src/libs/routes_v1/activity.js +++ b/src/libs/routes_v1/activity.js @@ -31,17 +31,12 @@ activityApp.get('/', async (req, res, next) => { const page = parseInt(req.query.page) || 1; const pageSize = parseInt(req.query.pageSize) || 5; try { - const totalCount = await Activity.count({where: { - is_draft: false - }}); + const totalCount = await Activity.count(); const offset = (page - 1) * pageSize; const acts = await Activity.findAll({ offset, limit: pageSize, - where: { - is_draft: false - }, order:[ ['date', 'DESC']] }); diff --git a/src/libs/routes_v1/publication.js b/src/libs/routes_v1/publication.js index e8792e709ad0f89c8f78b7e635769c62aa18b288..1d35269324274fbff225c44e5d765e28a379a07b 100644 --- a/src/libs/routes_v1/publication.js +++ b/src/libs/routes_v1/publication.js @@ -33,17 +33,12 @@ pubApp.get('/', async (req, res, next) => { const page = parseInt(req.query.page) || 1; // Current page number const pageSize = parseInt(req.query.pageSize) || 5; // Number of items per page try { - const totalCount = await Publication.count({ where: { - is_draft: false - }}); + const totalCount = await Publication.count(); const offset = (page - 1) * pageSize; const publis = await Publication.findAll({ offset, limit: pageSize, - where: { - is_draft: false - } }); res.json({