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

18 lines
554 B
JavaScript

module.exports = Self => {
require('../methods/worker-dms/downloadFile')(Self);
require('../methods/worker-dms/removeFile')(Self);
require('../methods/worker-dms/filter')(Self);
require('../methods/worker-dms/docuwareDownload')(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;
};
};