mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-31 08:23:34 +00:00
fix(mongo): refresh JSON viewer after document edit
The right-side JSON viewer was not updating after saving edits because editJson was stale — only load() was called, which updates the document list but not the displayed JSON preview.
This commit is contained in:
@@ -333,6 +333,9 @@ async function saveDoc() {
|
||||
isNew.value = false;
|
||||
editFields.value = [];
|
||||
await load();
|
||||
if (selectedIdx.value !== null && documents.value[selectedIdx.value]) {
|
||||
editJson.value = JSON.stringify(documents.value[selectedIdx.value], null, 2);
|
||||
}
|
||||
} catch (e: unknown) {
|
||||
error.value = String(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user