Fixed overview departments .js

This commit is contained in:
andrei-mihnea-cerbu
2025-02-12 18:33:20 +02:00
parent 3ed7efa806
commit 02fc5bc4c5
3 changed files with 13 additions and 8 deletions
@@ -10,11 +10,6 @@ document.addEventListener('DOMContentLoaded', async () => {
const closeCreateModalButton = document.getElementById('closeCreateModal');
const confirmCreateButton = document.getElementById('confirmCreateButton');
if (!await window.networkAPI.openUcSocket()) {
await window.uiAPI.showAlert('Internal error of the application. Unable to open socket.');
return;
}
backButton.addEventListener('click', async () => {
await window.networkAPI.closeUcSocket();
fadeOut('main_menu');
@@ -48,6 +43,11 @@ async function fetchDepartments() {
const departmentsContainer = document.getElementById('departments-container');
departmentsContainer.innerHTML = ''; // Clear any existing data
if (!await window.networkAPI.openUcSocket()) {
await window.uiAPI.showAlert('Internal error of the application. Unable to open socket.');
return;
}
// Retrieve the operation codes via IPC
const operationCodes = await window.networkAPI.getOperationsCodes();
if (!operationCodes) {