added bools for actionbar rendering
This commit is contained in:
@ -6,6 +6,7 @@ let solutions = [];
|
||||
let solution = {};
|
||||
let selectedSolutionsByCustomer = [];
|
||||
let selectedSolutionsBySolution = [];
|
||||
let selectedSolutionsByAsset = [];
|
||||
let solTodosBySolutionId = [];
|
||||
let insertId = -1;
|
||||
let errorMsg = '';
|
||||
@ -84,6 +85,38 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (event.path.startsWith("/api/getSelectedSolutionsByAsset")) {
|
||||
// get selected solutions object by asset from backend
|
||||
let filteredAsset = null;
|
||||
const path = event._path;
|
||||
const pathSegments = path.split('/');
|
||||
filteredAsset = pathSegments[pathSegments.length - 1];
|
||||
|
||||
try {
|
||||
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/selectedSolutionsByAssetName/${filteredAsset}`);
|
||||
selectedSolutionsByAsset = res.data;
|
||||
} catch (err) {
|
||||
if (axios.isAxiosError(err)) {
|
||||
const axiosError = err as AxiosError;
|
||||
|
||||
if (axiosError.response) {
|
||||
// Axios error
|
||||
console.error(axiosError.response.data.message);
|
||||
errorMsg = axiosError.response.data.message;
|
||||
} else if (axiosError.request) {
|
||||
// If error was caused by the request
|
||||
console.error(axiosError.request);
|
||||
} else {
|
||||
// Other errors
|
||||
console.error('Error', axiosError.message);
|
||||
}
|
||||
} else {
|
||||
// No AxiosError
|
||||
console.error('Error', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.path.startsWith("/api/getSelectedSolutionsBySolution")) {
|
||||
// get selected solutions object by asset from backend
|
||||
let filteredSolution = null;
|
||||
@ -391,4 +424,4 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
})
|
||||
|
||||
export { solutions, solution, selectedSolutionsByCustomer, selectedSolutionsBySolution, solTodosBySolutionId, insertId, errorMsg };
|
||||
export { solutions, solution, selectedSolutionsByAsset, selectedSolutionsByCustomer, selectedSolutionsBySolution, solTodosBySolutionId, insertId, errorMsg };
|
||||
Reference in New Issue
Block a user