added right actionbar icons and asset solution list

This commit is contained in:
2024-03-15 20:05:01 +01:00
parent 3613565b39
commit 29fd2e0a15
15 changed files with 232 additions and 67 deletions

View File

@ -8,6 +8,7 @@ let selectedSolutionsByCustomer = [];
let selectedSolutionsBySolution = [];
let selectedSolutionsByAsset = [];
let solTodosBySolutionId = [];
let selectedSolutionsByType = [];
let insertId = -1;
let errorMsg = '';
@ -117,6 +118,38 @@ export default defineEventHandler(async (event) => {
}
}
if (event.path.startsWith("/api/getSelectedSolutionsByType")) {
// get selected solutions object by type from backend
let filteredType = null;
const path = event._path;
const pathSegments = path.split('/');
filteredType = pathSegments[pathSegments.length - 1];
try {
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/selectedSolutionsByType/${filteredType}`);
selectedSolutionsByType = 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;
@ -424,4 +457,4 @@ export default defineEventHandler(async (event) => {
})
export { solutions, solution, selectedSolutionsByAsset, selectedSolutionsByCustomer, selectedSolutionsBySolution, solTodosBySolutionId, insertId, errorMsg };
export { solutions, solution, selectedSolutionsByType, selectedSolutionsByAsset, selectedSolutionsByCustomer, selectedSolutionsBySolution, solTodosBySolutionId, insertId, errorMsg };