mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-19 08:51:37 +03:00
QFix: add limit to count queries (#7458)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
parent
5b1f0a6c35
commit
a122f866e8
@ -106,9 +106,14 @@
|
||||
|
||||
const starredQuery = createQuery()
|
||||
let isStarred = false
|
||||
$: starredQuery.query(document.class.SavedDocument, { attachedTo: _id }, (res) => {
|
||||
isStarred = res.length !== 0
|
||||
})
|
||||
$: starredQuery.query(
|
||||
document.class.SavedDocument,
|
||||
{ attachedTo: _id },
|
||||
(res) => {
|
||||
isStarred = res.length !== 0
|
||||
},
|
||||
{ limit: 1 }
|
||||
)
|
||||
|
||||
async function createEmbedding (file: File): Promise<{ file: Ref<Blob>, type: string } | undefined> {
|
||||
if (doc === undefined) {
|
||||
|
@ -34,9 +34,11 @@
|
||||
products.class.ProductVersion,
|
||||
{ space: objectId },
|
||||
(res) => {
|
||||
versions = res.length
|
||||
versions = res.total
|
||||
},
|
||||
{
|
||||
total: true,
|
||||
limit: 1,
|
||||
projection: { _id: 1 }
|
||||
}
|
||||
)
|
||||
|
@ -30,9 +30,14 @@
|
||||
let applications: number
|
||||
|
||||
const query = createQuery()
|
||||
$: query.query(recruit.class.Applicant, { space: objectId }, (res) => {
|
||||
applications = res.length
|
||||
})
|
||||
$: query.query(
|
||||
recruit.class.Applicant,
|
||||
{ space: objectId },
|
||||
(res) => {
|
||||
applications = res.total
|
||||
},
|
||||
{ total: true, limit: 1 }
|
||||
)
|
||||
|
||||
const createApp = (ev: MouseEvent): void => {
|
||||
showPopup(CreateApplication, { space: objectId, preserveVacancy: true }, ev.target as HTMLElement)
|
||||
|
@ -47,10 +47,12 @@
|
||||
core.class.TypedSpace,
|
||||
{ type: type._id },
|
||||
(res) => {
|
||||
spacesCount = res.length
|
||||
spacesCount = res.total
|
||||
loading = false
|
||||
},
|
||||
{
|
||||
total: true,
|
||||
limit: 1,
|
||||
projection: { _id: 1 }
|
||||
}
|
||||
)
|
||||
|
@ -71,9 +71,11 @@
|
||||
task.class.Task,
|
||||
{ kind: taskType._id },
|
||||
(res) => {
|
||||
tasksCounter = res.length
|
||||
tasksCounter = res.total
|
||||
},
|
||||
{
|
||||
total: true,
|
||||
limit: 1,
|
||||
projection: {
|
||||
_id: 1
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
testManagement.class.TestCase,
|
||||
query,
|
||||
(res) => {
|
||||
testCases = res.length
|
||||
testCases = res.total
|
||||
},
|
||||
{ total: true, limit: 1 }
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user