Remove validation for survey name

This commit is contained in:
unknown 2025-12-10 14:47:20 +05:30
parent 74751cf357
commit c7f0846897

View File

@ -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 }});