added right actionbar icons and asset solution list
This commit is contained in:
@ -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 };
|
||||
Reference in New Issue
Block a user