mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-26 11:34:58 +02:00
Query update fix (#728)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
@@ -37,14 +37,18 @@
|
||||
let objects: Doc[]
|
||||
|
||||
const q = createQuery()
|
||||
$: q.query(
|
||||
_class,
|
||||
query,
|
||||
(result) => {
|
||||
objects = result
|
||||
},
|
||||
{ sort: { [sortKey]: sortOrder }, ...options, limit: 200 }
|
||||
)
|
||||
|
||||
async function update(_class: Ref<Class<Doc>>, query: DocumentQuery<Doc>, sortKey: string, sortOrder: SortingOrder, options?: FindOptions<Doc>) {
|
||||
q.query(
|
||||
_class,
|
||||
query,
|
||||
(result) => {
|
||||
objects = result
|
||||
},
|
||||
{ sort: { [sortKey]: sortOrder }, ...options, limit: 200 }
|
||||
)
|
||||
}
|
||||
$: update(_class, query, sortKey, sortOrder, options)
|
||||
|
||||
function getValue (doc: Doc, key: string): any {
|
||||
if (key.length === 0) {
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
export let config: string[]
|
||||
export let search: string = ''
|
||||
|
||||
$: query = search === '' ? { space } : { $search: search, space }
|
||||
$: resultQuery = search === '' ? { space, ...query } : { $search: search, space, ...query }
|
||||
</script>
|
||||
|
||||
<div class="tableview-container">
|
||||
<ScrollBox vertical stretch noShift>
|
||||
<Table {_class} {config} {options} {query} {baseMenuClass} enableChecking />
|
||||
<Table {_class} {config} {options} query={resultQuery} {baseMenuClass} enableChecking />
|
||||
</ScrollBox>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user