fix refreshSupps: lowercase keys (api.cfm возвращает ok/rows/columns) (v1.0.58)
This commit is contained in:
@@ -61,7 +61,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="topbar">
|
<div class="topbar">
|
||||||
<img src="/nubes-logo.svg" alt="Nubes">
|
<img src="/nubes-logo.svg" alt="Nubes">
|
||||||
<span class="title">Сверка договоров — LLM <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.57 — Lucee</span></span>
|
<span class="title">Сверка договоров — LLM <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.58 — Lucee</span></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -327,10 +327,10 @@ async function refreshSupps() {
|
|||||||
try {
|
try {
|
||||||
var resp = await fetch('/api.cfm?action=query&sql=' + encodeURIComponent("SELECT s.id, s.type, s.document_id FROM supplements s WHERE s.contract_id='" + contractId + "'"));
|
var resp = await fetch('/api.cfm?action=query&sql=' + encodeURIComponent("SELECT s.id, s.type, s.document_id FROM supplements s WHERE s.contract_id='" + contractId + "'"));
|
||||||
var data = await resp.json();
|
var data = await resp.json();
|
||||||
if (data.OK && data.ROWS) {
|
if (data.ok && data.rows) {
|
||||||
data.ROWS.forEach(function(r) {
|
data.rows.forEach(function(r) {
|
||||||
var supp = {};
|
var supp = {};
|
||||||
data.COLUMNS.forEach(function(c, ci) { supp[c] = r[ci]; });
|
data.columns.forEach(function(c, ci) { supp[c] = r[ci]; });
|
||||||
for (var i = 0; i < fileQueue.length; i++) {
|
for (var i = 0; i < fileQueue.length; i++) {
|
||||||
if (fileQueue[i].doc_id === supp.document_id) {
|
if (fileQueue[i].doc_id === supp.document_id) {
|
||||||
fileQueue[i].supp_id = supp.id;
|
fileQueue[i].supp_id = supp.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user