Jobserve and s1Jobs rss scraper added
This commit is contained in:
parent
538275cb37
commit
581989c9b4
4
dist/build/bundle.css
vendored
4
dist/build/bundle.css
vendored
File diff suppressed because one or more lines are too long
6
dist/build/bundle.css.map
vendored
6
dist/build/bundle.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/build/bundle.js
vendored
2
dist/build/bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/build/bundle.js.map
vendored
2
dist/build/bundle.js.map
vendored
File diff suppressed because one or more lines are too long
@ -97,4 +97,19 @@ exports.appliedOne = (data) => {
|
||||
});
|
||||
};
|
||||
|
||||
exports.markAllRead = () => {
|
||||
const sql = 'insert into read (rid, d) select jobs._id as rid, strftime(\'%s\',\'now\') as d from jobs left join read on read.rid = jobs._id where read.d is null order by jobs._id desc;';
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
db.run(sql, [], function(err) {
|
||||
if (err && err.errno !== 19) {
|
||||
console.log(err);
|
||||
reject(err);
|
||||
}
|
||||
|
||||
resolve({});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// select _id, title, site, company, timestamp from jobs order by _id desc;
|
||||
|
@ -32,3 +32,19 @@ exports.markApplied = (req, res) => {
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
exports.markAllRead = (req, res) => {
|
||||
console.log('>markAllRead req', req.params);
|
||||
|
||||
dbmanager.markAllRead()
|
||||
.then((data) => {
|
||||
console.log(data);
|
||||
|
||||
res.status(200).end();
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(500).send({
|
||||
'message': err.message || 'Some error occurred while querying the database.'
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -11,4 +11,7 @@ const apply = require('../controllers/apply.controller');
|
||||
module.exports = (app) => {
|
||||
app.route('/apply/:id')
|
||||
.put(apply.markApplied);
|
||||
|
||||
app.route('/readall')
|
||||
.put(apply.markAllRead);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user