1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-19 22:18:03 +00:00

Form bugfixes

This commit is contained in:
2023-01-29 20:16:31 +01:00
parent 99108121c3
commit dc5b12ee0d
6 changed files with 13 additions and 14 deletions

View File

@ -19,15 +19,14 @@
$: viewsForCollection = views.forCollection(collection.hostKey, collection.dbKey, collection.key);
$: oppositeViewType = viewType === 'table' ? 'form' : 'table';
$: if (collection.viewKey !== 'list') {
json = JSON.stringify(newItems, undefined, 2);
}
async function insert() {
if (collection.viewKey === 'list') {
insertedIds = await InsertItems(collection.hostKey, collection.dbKey, collection.key, json);
}
else {
insertedIds = await InsertItems(collection.hostKey, collection.dbKey, collection.key, JSON.stringify(newItems));
if (insertedIds) {
newItems = [];
}
insertedIds = await InsertItems(collection.hostKey, collection.dbKey, collection.key, json);
if ((collection.viewKey === 'list') && insertedIds) {
newItems = [];
}
}