salix/modules/worker/back/models/worker-dms.js

17 lines
493 B
JavaScript
Raw Normal View History

2019-11-22 09:42:05 +00:00
module.exports = Self => {
2020-04-03 15:52:47 +00:00
require('../methods/worker-dms/downloadFile')(Self);
2019-11-22 09:42:05 +00:00
require('../methods/worker-dms/removeFile')(Self);
2020-04-03 15:52:47 +00:00
require('../methods/worker-dms/filter')(Self);
Self.isMine = async function(ctx, dmsId) {
const myUserId = ctx.req.accessToken.userId;
let workerDms = await Self.findOne({
where: {
workerFk: myUserId,
dmsFk: dmsId
}
});
return workerDms !== null;
};
2019-11-22 09:42:05 +00:00
};