Remove validation for survey name
This commit is contained in:
parent
74751cf357
commit
c7f0846897
@ -7,22 +7,12 @@ const EstablishmentUser = db.EstablishmentUser;
|
||||
const { sendEmailService } = require("../services/email.service");
|
||||
|
||||
// Create new configuration
|
||||
|
||||
exports.createConfig = async (req, res) => {
|
||||
try {
|
||||
|
||||
const {survey_name, quarter, year, start_date, end_date } = req.body;
|
||||
const {quarter, year, start_date, end_date } = req.body;
|
||||
|
||||
const surveyNameExists = await QuarterlyWindowsConfiguration.findOne({
|
||||
where: { survey_name, is_active: true }
|
||||
});
|
||||
|
||||
if (surveyNameExists) {
|
||||
return res.status(400).json({
|
||||
status: "failed",
|
||||
message: `Survey Name '${survey_name}' already exists.`
|
||||
});
|
||||
}
|
||||
|
||||
// find config
|
||||
const exists = await QuarterlyWindowsConfiguration.findOne({where: { quarter, year }});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user