1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 13:07:58 +00:00

Made it possible to input loose JSON into find view inputs

I.e. `{ key: 'val' }` or `{ 'num': 2 }` besides `{ "strict": "json" }`.
This commit is contained in:
Romein van Buren 2023-06-24 16:05:33 +02:00
parent 3e293910ea
commit eef74b306b
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
2 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,7 @@
## [Unreleased]
* Open dump in Explorer/Finder when finished (#43).
* Made it possible (again) to input loose JSON into find view inputs, i.e. `{ key: 'val' }` or `{ 'num': 2 }` besides `{ "strict": "json" }`.
## [v0.2.1]

View File

@ -48,7 +48,13 @@
querying = `Querying ${collection.key}…`;
activePath = [];
const newResult = await FindItems(collection.hostKey, collection.dbKey, collection.key, JSON.stringify(form));
const newResult = await FindItems(collection.hostKey, collection.dbKey, collection.key, JSON.stringify({
fields: convertLooseJson(form.fields || defaults.fields),
limit: form.limit ?? defaults.limit,
query: convertLooseJson(form.query) || defaults.query,
skip: form.skip ?? defaults.skip,
sort: convertLooseJson(form.sort) || defaults.sort,
}));
if (newResult) {
newResult.results = newResult.results?.map(s => EJSON.parse(s, { relaxed: false }));