added a check on api/claim/publish for disabled publishing
This commit is contained in:
parent
9e1c7afa55
commit
f9db87109c
1 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
const logger = require('winston');
|
const logger = require('winston');
|
||||||
|
|
||||||
const { details: { host } } = require('@config/siteConfig');
|
const { details: { host }, publishing: { disabled, disabledMessage } } = require('@config/siteConfig');
|
||||||
|
|
||||||
const { sendGATimingEvent } = require('../../../../utils/googleAnalytics.js');
|
const { sendGATimingEvent } = require('../../../../utils/googleAnalytics.js');
|
||||||
|
|
||||||
|
@ -28,6 +28,13 @@ const claimPublish = ({ body, files, headers, ip, originalUrl, user }, res) => {
|
||||||
ip,
|
ip,
|
||||||
body,
|
body,
|
||||||
});
|
});
|
||||||
|
// check for disabled publishing
|
||||||
|
if (disabled) {
|
||||||
|
return res.status(400).json({
|
||||||
|
success: false,
|
||||||
|
message: disabledMessage
|
||||||
|
});
|
||||||
|
}
|
||||||
// define variables
|
// define variables
|
||||||
let channelName, channelId, channelPassword, description, fileName, filePath, fileType, gaStartTime, license, name, nsfw, thumbnail, thumbnailFileName, thumbnailFilePath, thumbnailFileType, title;
|
let channelName, channelId, channelPassword, description, fileName, filePath, fileType, gaStartTime, license, name, nsfw, thumbnail, thumbnailFileName, thumbnailFilePath, thumbnailFileType, title;
|
||||||
// record the start time of the request
|
// record the start time of the request
|
||||||
|
|
Loading…
Reference in a new issue