修复创建项目500错误:code列名改为project_code
This commit is contained in:
@@ -368,7 +368,7 @@ router.post('/', async (req, res) => {
|
|||||||
String(Math.floor(Math.random() * 10000)).padStart(4, '0');
|
String(Math.floor(Math.random() * 10000)).padStart(4, '0');
|
||||||
|
|
||||||
const result = await db.query(
|
const result = await db.query(
|
||||||
`INSERT INTO projects (name, code, customer_id, project_manager_id, contract_amount, start_date, end_date, description, status, location, type_template_id, created_at, updated_at)
|
`INSERT INTO projects (name, project_code, customer_id, project_manager_id, contract_amount, start_date, end_date, description, status, location, type_template_id, created_at, updated_at)
|
||||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
|
||||||
RETURNING id`,
|
RETURNING id`,
|
||||||
[name, projectCode, customer_id || null, manager_id || null, contract_amount || 0, start_date || '', end_date || '', description || '', status || 'planning', location || '', type_template_id || null]
|
[name, projectCode, customer_id || null, manager_id || null, contract_amount || 0, start_date || '', end_date || '', description || '', status || 'planning', location || '', type_template_id || null]
|
||||||
|
|||||||
Reference in New Issue
Block a user