Files
talk/services/moderation/phases/assetClosed.js
T
2018-01-22 16:11:13 -07:00

10 lines
337 B
JavaScript

const { ErrAssetCommentingClosed } = require('../../../errors');
// This phase checks to see if the asset being processed is closed or not.
module.exports = (ctx, comment, { asset }) => {
// Check to see if the asset has closed commenting...
if (asset.isClosed) {
throw new ErrAssetCommentingClosed(asset.closedMessage);
}
};