implemented mvt and solutions

This commit is contained in:
2024-03-04 10:24:55 +01:00
parent 1e001bb4a1
commit 488eba45e1
57 changed files with 3389 additions and 1125 deletions

View File

@ -46,6 +46,7 @@ export const getSolutionByName = async (id, result) => {
export const insertSolution = async (data, result) => {
try {
const results = await ownConn.query(`INSERT INTO solutions(solutionName, assetName, customer, customerID, type, lastView, user, description, notes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.solutionName, data.assetName, data.customer, data.customerID, data.type, data.lastView, data.user, data.description, data.notes])
results.insertId = results.insertId.toString();
result(null, results);
}
catch (err) {
@ -61,6 +62,7 @@ export const updateSolutionById = async (data, result) => {
const id = data.primaryID;
let sql = `UPDATE solutions SET solutionName = ?, assetName = ?, customer = ?, customerID = ?, type = ?, lastView = ?, user = ?, description = ?, notes = ? WHERE primaryID = ?`;
const results = await ownConn.query(sql, [data.solutionName, data.assetName, data.customer, data.customerID, data.type, data.lastView, data.user, data.description, data.notes, id])
results.insertId = results.insertId.toString();
result(null, results);
}
catch (err) {
@ -131,6 +133,7 @@ export const deleteSolutionById = async (id, result) => {
try {
let sql = `DELETE FROM solutions WHERE primaryID = ?`;
const results = await ownConn.query(sql, [id])
results.insertId = results.insertId.toString();
result(null, results);
}
catch (err) {
@ -138,4 +141,4 @@ export const deleteSolutionById = async (id, result) => {
console.log("SQL error : ", err);
result(err, null);
}
};
};