fixed backend imports

This commit is contained in:
2024-02-16 19:00:30 +01:00
parent 5ca56d36cf
commit 5242d4a3af
26 changed files with 195 additions and 279 deletions

View File

@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
//get single master production order todo
export const getMasterProductionOrderTodoById = async (id, result) => {
try {
let sql = `SELECT * FROM masterOrderTodos WHERE templateID = ? ORDER BY rowID ASC`;
let sql = `SELECT * FROM masterordertodos WHERE templateID = ? ORDER BY rowID ASC`;
const results = await ownConn.execute(sql, [id])
result(null, results);
}
@ -18,7 +18,7 @@ export const getMasterProductionOrderTodoById = async (id, result) => {
export const updateMasterProductionOrderTodoById = async (data, result) => {
try {
const id = data.primaryID;
let sql = `UPDATE masterOrderTodos SET templateID = ?, asset = ? , task = ?, comment = ? WHERE primaryID = ?`;
let sql = `UPDATE masterordertodos SET templateID = ?, asset = ? , task = ?, comment = ? WHERE primaryID = ?`;
const results = await ownConn.query(sql, [data.templateID, data.asset, data.task, data.comment, id])
result(null, results);
}
@ -33,7 +33,7 @@ export const updateMasterProductionOrderTodoById = async (data, result) => {
// Delete master production order todo to Database
export const deleteMasterProductionOrderTodoById = async (id, result) => {
try {
let sql = `DELETE FROM masterOrderTodos WHERE primaryID = ?`;
let sql = `DELETE FROM masterordertodos WHERE primaryID = ?`;
const results = await ownConn.query(sql, [id])
result(null, results);
}
@ -47,7 +47,7 @@ export const deleteMasterProductionOrderTodoById = async (id, result) => {
// Delete master production order todo by templateID to Database
export const deleteMasterProductionOrderTodoByTemplateId = async (id, result) => {
try {
let sql = `DELETE FROM masterOrderTodos WHERE templateID = ?`;
let sql = `DELETE FROM masterordertodos WHERE templateID = ?`;
const results = await ownConn.query(sql, [id])
result(null, results);
}
@ -61,7 +61,7 @@ export const deleteMasterProductionOrderTodoByTemplateId = async (id, result) =>
// Update all master production order todos to Database
export const updateMasterProductionOrderTodos = async (data, result) => {
try {
let sql = `UPDATE masterOrderTodos SET rowID = ? WHERE primaryID = ?`;
let sql = `UPDATE masterordertodos SET rowID = ? WHERE primaryID = ?`;
data.data.forEach(async i => {
let id = i.primaryID;
let rowId = i.rowID;
@ -79,7 +79,7 @@ export const updateMasterProductionOrderTodos = async (data, result) => {
//insert master production order todo to databased
export const insertMasterProductionOrderTodo = async (data, result) => {
try {
const results = await ownConn.query(`INSERT INTO masterOrderTodos(templateID, rowID, asset, task, comment) VALUES(?, ?, ?, ?, ?)`, [data.templateID, data.rowID, data.asset, data.task, data.comment])
const results = await ownConn.query(`INSERT INTO masterordertodos(templateID, rowID, asset, task, comment) VALUES(?, ?, ?, ?, ?)`, [data.templateID, data.rowID, data.asset, data.task, data.comment])
result(null, results);
}
catch (err) {