mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 16:41:24 +03:00
20 lines
341 B
JavaScript
20 lines
341 B
JavaScript
|
class JobsRepository {
|
||
|
constructor({JobModel}) {
|
||
|
this._JobModel = JobModel;
|
||
|
}
|
||
|
|
||
|
async add(data) {
|
||
|
const job = await this._JobModel.add(data);
|
||
|
|
||
|
return job;
|
||
|
}
|
||
|
|
||
|
async read(name) {
|
||
|
const job = await this._JobModel.findOne({name});
|
||
|
|
||
|
return job;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = JobsRepository;
|