Show error message in admin docs panel instead of staying on Loading
Build and Push Docker Image / build-and-push (push) Successful in 38s
Build and Push Docker Image / build-and-push (push) Successful in 38s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ad3e0bc7be
commit
3eb6322427
1 file changed
+7
-1
+7
-1
@@ -3296,8 +3296,14 @@ $('#app-settings-form').addEventListener('submit', async (e) => {
|
|||||||
let adminDocsEditorInstance = null;
|
let adminDocsEditorInstance = null;
|
||||||
|
|
||||||
async function loadAdminDocs() {
|
async function loadAdminDocs() {
|
||||||
const { docs } = await api('/api/admin/docs');
|
|
||||||
const el = $('#admin-docs-list');
|
const el = $('#admin-docs-list');
|
||||||
|
let docs;
|
||||||
|
try {
|
||||||
|
({ docs } = await api('/api/admin/docs'));
|
||||||
|
} catch (err) {
|
||||||
|
el.innerHTML = `<p class="hint" style="color:red">Error loading documents: ${esc(err.message)}</p>`;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!docs.length) {
|
if (!docs.length) {
|
||||||
el.innerHTML = '<p class="hint">No submitted documents yet.</p>';
|
el.innerHTML = '<p class="hint">No submitted documents yet.</p>';
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user