fix: лого SVG, убран Добавить (onchange), create_contract возвращает id, JS без лишнего GET

This commit is contained in:
2026-06-15 06:52:54 +04:00
parent 4b68ad70c5
commit 46b6bee913
3 changed files with 24 additions and 14 deletions
+4 -6
View File
@@ -107,10 +107,7 @@
</div>
<div class="card-body">
<div class="form-row">
<input type="file" id="fileInput" accept=".docx,.doc,.pdf,.zip" multiple style="height:36px;">
<button class="btn btn-primary" onclick="addFiles()">
<i data-lucide="plus" style="width:16px;height:16px;"></i> Добавить
</button>
<input type="file" id="fileInput" accept=".docx,.doc,.pdf,.zip" multiple style="height:36px;" onchange="addFiles()">
</div>
<div class="queue" id="queue"></div>
<div class="queue-empty" id="queueEmpty">Нет добавленных файлов</div>
@@ -197,8 +194,9 @@
method: 'POST', headers: {'Content-Type': 'application/json'},
body: JSON.stringify({number: 'б/н ' + new Date().toISOString().slice(0,10)}),
});
const listResp = await fetch('/api/contracts');
contractId = (await listResp.json()).contracts[0].id;
const data = await resp.json();
if (!resp.ok || !data.id) throw new Error(data.error || 'no id');
contractId = data.id;
} catch (e) {
resultsBody.innerHTML = '<div class="error-box">❌ ' + e.message + '</div>';
resetBtn(); return;