修改小程序,前端,官网跳转路径
This commit is contained in:
199
government-backend/controllers/HarmlessPlaceController.js
Normal file
199
government-backend/controllers/HarmlessPlaceController.js
Normal file
@@ -0,0 +1,199 @@
|
||||
const { validationResult } = require('express-validator');
|
||||
const { Op } = require('sequelize');
|
||||
const HarmlessPlace = require('../models/HarmlessPlace');
|
||||
|
||||
// 获取无害化场所列表
|
||||
exports.getList = async (req, res) => {
|
||||
try {
|
||||
const { page = 1, pageSize = 10, keyword = '', status = '' } = req.query;
|
||||
const offset = (page - 1) * pageSize;
|
||||
|
||||
const where = {};
|
||||
|
||||
if (keyword) {
|
||||
where[Op.or] = [
|
||||
{ name: { [Op.like]: `%${keyword}%` } },
|
||||
{ licenseNumber: { [Op.like]: `%${keyword}%` } }
|
||||
];
|
||||
}
|
||||
|
||||
if (status) {
|
||||
where.status = status;
|
||||
}
|
||||
|
||||
// 移除排序部分,避免使用不存在的created_at字段
|
||||
const result = await HarmlessPlace.findAndCountAll({
|
||||
where,
|
||||
attributes: ['id', 'name', 'address', 'contactPerson', 'contactPhone', 'licenseNumber', 'status'],
|
||||
limit: parseInt(pageSize),
|
||||
offset: parseInt(offset)
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '获取成功',
|
||||
data: {
|
||||
list: result.rows,
|
||||
total: result.count
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('获取无害化场所列表失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '获取失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 获取无害化场所详情
|
||||
exports.getDetail = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const place = await HarmlessPlace.findByPk(id);
|
||||
|
||||
if (!place) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '无害化场所不存在'
|
||||
});
|
||||
}
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '获取成功',
|
||||
data: place
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('获取无害化场所详情失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '获取失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 创建无害化场所
|
||||
exports.create = async (req, res) => {
|
||||
try {
|
||||
// 验证请求数据
|
||||
const errors = validationResult(req);
|
||||
if (!errors.isEmpty()) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '参数错误',
|
||||
errors: errors.array()
|
||||
});
|
||||
}
|
||||
|
||||
const { name, address, contactPerson, contactPhone, licenseNumber, status } = req.body;
|
||||
|
||||
// 创建无害化场所
|
||||
const place = await HarmlessPlace.create({
|
||||
name,
|
||||
address,
|
||||
contactPerson,
|
||||
contactPhone,
|
||||
licenseNumber,
|
||||
status: status || '正常'
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '创建成功',
|
||||
data: place
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('创建无害化场所失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '创建失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 更新无害化场所
|
||||
exports.update = async (req, res) => {
|
||||
try {
|
||||
// 验证请求数据
|
||||
const errors = validationResult(req);
|
||||
if (!errors.isEmpty()) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '参数错误',
|
||||
errors: errors.array()
|
||||
});
|
||||
}
|
||||
|
||||
const { id } = req.params;
|
||||
const { name, address, contactPerson, contactPhone, licenseNumber, status } = req.body;
|
||||
|
||||
// 查找无害化场所
|
||||
const place = await HarmlessPlace.findByPk(id);
|
||||
|
||||
if (!place) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '无害化场所不存在'
|
||||
});
|
||||
}
|
||||
|
||||
// 更新无害化场所
|
||||
await place.update({
|
||||
name,
|
||||
address,
|
||||
contactPerson,
|
||||
contactPhone,
|
||||
licenseNumber,
|
||||
status
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '更新成功',
|
||||
data: place
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('更新无害化场所失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '更新失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 删除无害化场所
|
||||
exports.delete = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
|
||||
// 查找无害化场所
|
||||
const place = await HarmlessPlace.findByPk(id);
|
||||
|
||||
if (!place) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '无害化场所不存在'
|
||||
});
|
||||
}
|
||||
|
||||
// 删除无害化场所
|
||||
await place.destroy();
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '删除成功'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('删除无害化场所失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '删除失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
235
government-backend/controllers/HarmlessRegistrationController.js
Normal file
235
government-backend/controllers/HarmlessRegistrationController.js
Normal file
@@ -0,0 +1,235 @@
|
||||
const { validationResult } = require('express-validator');
|
||||
const { Op } = require('sequelize');
|
||||
const HarmlessRegistration = require('../models/HarmlessRegistration');
|
||||
|
||||
// 获取无害化登记列表
|
||||
exports.getList = async (req, res) => {
|
||||
try {
|
||||
const { page = 1, pageSize = 10, keyword = '', startDate = '', endDate = '' } = req.query;
|
||||
const offset = (page - 1) * pageSize;
|
||||
|
||||
const where = {};
|
||||
|
||||
if (keyword) {
|
||||
where.registrationNumber = { [Op.like]: `%${keyword}%` };
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
where.processingDate = where.processingDate || {};
|
||||
where.processingDate[Op.gte] = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
where.processingDate = where.processingDate || {};
|
||||
where.processingDate[Op.lte] = endDate;
|
||||
}
|
||||
|
||||
const result = await HarmlessRegistration.findAndCountAll({
|
||||
where,
|
||||
limit: parseInt(pageSize),
|
||||
offset: parseInt(offset),
|
||||
order: [['createTime', 'DESC']]
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '获取成功',
|
||||
data: {
|
||||
list: result.rows,
|
||||
total: result.count
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('获取无害化登记列表失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '获取失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 获取无害化登记详情
|
||||
exports.getDetail = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const registration = await HarmlessRegistration.findByPk(id);
|
||||
|
||||
if (!registration) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '无害化登记不存在'
|
||||
});
|
||||
}
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '获取成功',
|
||||
data: registration
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('获取无害化登记详情失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '获取失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 创建无害化登记
|
||||
exports.create = async (req, res) => {
|
||||
try {
|
||||
// 验证请求参数
|
||||
const errors = validationResult(req);
|
||||
if (!errors.isEmpty()) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '参数验证失败',
|
||||
errors: errors.array()
|
||||
});
|
||||
}
|
||||
|
||||
const { registrationNumber, animalType, quantity, reason,
|
||||
processingMethod, processingPlace, processingDate, registrant, status } = req.body;
|
||||
|
||||
// 检查登记编号是否已存在
|
||||
const existingRegistration = await HarmlessRegistration.findOne({
|
||||
where: { registrationNumber }
|
||||
});
|
||||
|
||||
if (existingRegistration) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '登记编号已存在'
|
||||
});
|
||||
}
|
||||
|
||||
const registration = await HarmlessRegistration.create({
|
||||
registrationNumber,
|
||||
animalType,
|
||||
quantity: parseInt(quantity),
|
||||
reason,
|
||||
processingMethod,
|
||||
processingPlace,
|
||||
processingDate,
|
||||
registrant,
|
||||
status: status || '待处理',
|
||||
createTime: new Date(),
|
||||
updateTime: new Date()
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '创建成功',
|
||||
data: registration
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('创建无害化登记失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '创建失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 更新无害化登记
|
||||
exports.update = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const errors = validationResult(req);
|
||||
|
||||
if (!errors.isEmpty()) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '参数验证失败',
|
||||
errors: errors.array()
|
||||
});
|
||||
}
|
||||
|
||||
const registration = await HarmlessRegistration.findByPk(id);
|
||||
|
||||
if (!registration) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '无害化登记不存在'
|
||||
});
|
||||
}
|
||||
|
||||
const { registrationNumber, animalType, quantity, reason,
|
||||
processingMethod, processingPlace, processingDate, registrant, status } = req.body;
|
||||
|
||||
// 检查登记编号是否已被其他记录使用
|
||||
if (registrationNumber && registrationNumber !== registration.registrationNumber) {
|
||||
const existingRegistration = await HarmlessRegistration.findOne({
|
||||
where: {
|
||||
registrationNumber,
|
||||
id: { [Op.ne]: id }
|
||||
}
|
||||
});
|
||||
|
||||
if (existingRegistration) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '登记编号已存在'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await registration.update({
|
||||
registrationNumber: registrationNumber || registration.registrationNumber,
|
||||
animalType: animalType || registration.animalType,
|
||||
quantity: quantity !== undefined ? parseInt(quantity) : registration.quantity,
|
||||
reason: reason || registration.reason,
|
||||
processingMethod: processingMethod || registration.processingMethod,
|
||||
processingPlace: processingPlace || registration.processingPlace,
|
||||
processingDate: processingDate || registration.processingDate,
|
||||
registrant: registrant || registration.registrant,
|
||||
status: status !== undefined ? status : registration.status,
|
||||
updateTime: new Date()
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '更新成功',
|
||||
data: registration
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('更新无害化登记失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '更新失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 删除无害化登记
|
||||
exports.delete = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const registration = await HarmlessRegistration.findByPk(id);
|
||||
|
||||
if (!registration) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '无害化登记不存在'
|
||||
});
|
||||
}
|
||||
|
||||
await registration.destroy();
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '删除成功'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('删除无害化登记失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '删除失败',
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
};
|
||||
268
government-backend/controllers/SlaughterhouseController.js
Normal file
268
government-backend/controllers/SlaughterhouseController.js
Normal file
@@ -0,0 +1,268 @@
|
||||
const { Op } = require('sequelize');
|
||||
const Slaughterhouse = require('../models/Slaughterhouse');
|
||||
|
||||
// 查询屠宰场列表
|
||||
exports.getSlaughterhouses = async (req, res) => {
|
||||
try {
|
||||
const { keyword, status, page = 1, pageSize = 10 } = req.query;
|
||||
|
||||
const where = {};
|
||||
|
||||
if (keyword) {
|
||||
where[Op.or] = [
|
||||
{ name: { [Op.like]: `%${keyword}%` } },
|
||||
{ contactPerson: { [Op.like]: `%${keyword}%` } },
|
||||
{ contactPhone: { [Op.like]: `%${keyword}%` } },
|
||||
{ licenseNumber: { [Op.like]: `%${keyword}%` } }
|
||||
];
|
||||
}
|
||||
|
||||
if (status) {
|
||||
where.status = status;
|
||||
}
|
||||
|
||||
const { count, rows } = await Slaughterhouse.findAndCountAll({
|
||||
where,
|
||||
offset: (page - 1) * pageSize,
|
||||
limit: parseInt(pageSize),
|
||||
order: [['created_at', 'DESC']]
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
data: {
|
||||
list: rows,
|
||||
total: count,
|
||||
page: parseInt(page),
|
||||
pageSize: parseInt(pageSize)
|
||||
},
|
||||
message: '查询成功'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('查询屠宰场列表失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '服务器内部错误'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 查询单个屠宰场详情
|
||||
exports.getSlaughterhouseById = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
|
||||
const slaughterhouse = await Slaughterhouse.findByPk(id);
|
||||
|
||||
if (!slaughterhouse) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '屠宰场不存在'
|
||||
});
|
||||
}
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
data: slaughterhouse,
|
||||
message: '查询成功'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('查询屠宰场详情失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '服务器内部错误'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 新增屠宰场
|
||||
exports.createSlaughterhouse = async (req, res) => {
|
||||
try {
|
||||
const { name, address, contactPerson, contactPhone, licenseNumber, status } = req.body;
|
||||
|
||||
// 检查名称是否重复
|
||||
const existingSlaughterhouse = await Slaughterhouse.findOne({
|
||||
where: { name }
|
||||
});
|
||||
|
||||
if (existingSlaughterhouse) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '该屠宰场名称已存在'
|
||||
});
|
||||
}
|
||||
|
||||
// 检查许可证号是否重复
|
||||
const existingLicense = await Slaughterhouse.findOne({
|
||||
where: { licenseNumber }
|
||||
});
|
||||
|
||||
if (existingLicense) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '该许可证号已存在'
|
||||
});
|
||||
}
|
||||
|
||||
const slaughterhouse = await Slaughterhouse.create({
|
||||
name,
|
||||
address,
|
||||
contactPerson,
|
||||
contactPhone,
|
||||
licenseNumber,
|
||||
status,
|
||||
createTime: new Date(),
|
||||
created_by: req.user?.id || null,
|
||||
updated_by: req.user?.id || null
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 201,
|
||||
data: slaughterhouse,
|
||||
message: '新增成功'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('新增屠宰场失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '服务器内部错误'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 更新屠宰场
|
||||
exports.updateSlaughterhouse = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const { name, address, contactPerson, contactPhone, licenseNumber, status } = req.body;
|
||||
|
||||
const slaughterhouse = await Slaughterhouse.findByPk(id);
|
||||
|
||||
if (!slaughterhouse) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '屠宰场不存在'
|
||||
});
|
||||
}
|
||||
|
||||
// 检查名称是否重复(排除当前屠宰场)
|
||||
if (name && name !== slaughterhouse.name) {
|
||||
const existingSlaughterhouse = await Slaughterhouse.findOne({
|
||||
where: {
|
||||
name,
|
||||
id: { [Op.ne]: id }
|
||||
}
|
||||
});
|
||||
|
||||
if (existingSlaughterhouse) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '该屠宰场名称已存在'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 检查许可证号是否重复(排除当前屠宰场)
|
||||
if (licenseNumber && licenseNumber !== slaughterhouse.licenseNumber) {
|
||||
const existingLicense = await Slaughterhouse.findOne({
|
||||
where: {
|
||||
licenseNumber,
|
||||
id: { [Op.ne]: id }
|
||||
}
|
||||
});
|
||||
|
||||
if (existingLicense) {
|
||||
return res.status(400).json({
|
||||
code: 400,
|
||||
message: '该许可证号已存在'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await slaughterhouse.update({
|
||||
name,
|
||||
address,
|
||||
contactPerson,
|
||||
contactPhone,
|
||||
licenseNumber,
|
||||
status,
|
||||
updated_by: req.user?.id || null
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
data: slaughterhouse,
|
||||
message: '更新成功'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('更新屠宰场失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '服务器内部错误'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 删除屠宰场
|
||||
exports.deleteSlaughterhouse = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
|
||||
const slaughterhouse = await Slaughterhouse.findByPk(id);
|
||||
|
||||
if (!slaughterhouse) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '屠宰场不存在'
|
||||
});
|
||||
}
|
||||
|
||||
await slaughterhouse.destroy();
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
message: '删除成功'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('删除屠宰场失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '服务器内部错误'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 切换屠宰场状态
|
||||
exports.toggleSlaughterhouseStatus = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
|
||||
const slaughterhouse = await Slaughterhouse.findByPk(id);
|
||||
|
||||
if (!slaughterhouse) {
|
||||
return res.status(404).json({
|
||||
code: 404,
|
||||
message: '屠宰场不存在'
|
||||
});
|
||||
}
|
||||
|
||||
const newStatus = slaughterhouse.status === 'active' ? 'inactive' : 'active';
|
||||
|
||||
await slaughterhouse.update({
|
||||
status: newStatus,
|
||||
updated_by: req.user?.id || null
|
||||
});
|
||||
|
||||
res.json({
|
||||
code: 200,
|
||||
data: slaughterhouse,
|
||||
message: '状态切换成功'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('切换屠宰场状态失败:', error);
|
||||
res.status(500).json({
|
||||
code: 500,
|
||||
message: '服务器内部错误'
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
const EpidemicAgency = require('../models/EpidemicAgency');
|
||||
const { Op } = require('sequelize');
|
||||
const EpidemicAgency = require('../models/EpidemicAgency');
|
||||
|
||||
// 查询防疫机构列表
|
||||
exports.getEpidemicAgencies = async (req, res) => {
|
||||
@@ -28,7 +28,7 @@ exports.getEpidemicAgencies = async (req, res) => {
|
||||
where,
|
||||
offset: (page - 1) * pageSize,
|
||||
limit: parseInt(pageSize),
|
||||
order: [['created_at', 'DESC']]
|
||||
attributes: ['id', 'name', 'director', 'phone', 'address', 'email', 'type', 'status', 'establishmentDate', 'epidemicScope', 'description']
|
||||
});
|
||||
|
||||
res.json({
|
||||
@@ -81,7 +81,7 @@ exports.getEpidemicAgencyById = async (req, res) => {
|
||||
// 新增防疫机构
|
||||
exports.createEpidemicAgency = async (req, res) => {
|
||||
try {
|
||||
const { name, director, phone, address, email, type, status, establishmentDate, description } = req.body;
|
||||
const { name, director, phone, address, email, type, status, establishmentDate, epidemicScope, description } = req.body;
|
||||
|
||||
const existingAgency = await EpidemicAgency.findOne({
|
||||
where: { name }
|
||||
@@ -103,6 +103,7 @@ exports.createEpidemicAgency = async (req, res) => {
|
||||
type,
|
||||
status,
|
||||
establishmentDate,
|
||||
epidemicScope,
|
||||
description,
|
||||
created_by: req.user?.id || null,
|
||||
updated_by: req.user?.id || null
|
||||
@@ -126,7 +127,7 @@ exports.createEpidemicAgency = async (req, res) => {
|
||||
exports.updateEpidemicAgency = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const { name, director, phone, address, email, type, status, establishmentDate, description } = req.body;
|
||||
const { name, director, phone, address, email, type, status, establishmentDate, epidemicScope, description } = req.body;
|
||||
|
||||
const agency = await EpidemicAgency.findByPk(id);
|
||||
|
||||
@@ -163,6 +164,7 @@ exports.updateEpidemicAgency = async (req, res) => {
|
||||
type,
|
||||
status,
|
||||
establishmentDate,
|
||||
epidemicScope,
|
||||
description,
|
||||
updated_by: req.user?.id || null
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user