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()
|
const starredQuery = createQuery()
|
||||||
let isStarred = false
|
let isStarred = false
|
||||||
$: starredQuery.query(document.class.SavedDocument, { attachedTo: _id }, (res) => {
|
$: starredQuery.query(
|
||||||
isStarred = res.length !== 0
|
document.class.SavedDocument,
|
||||||
})
|
{ attachedTo: _id },
|
||||||
|
(res) => {
|
||||||
|
isStarred = res.length !== 0
|
||||||
|
},
|
||||||
|
{ limit: 1 }
|
||||||
|
)
|
||||||
|
|
||||||
async function createEmbedding (file: File): Promise<{ file: Ref<Blob>, type: string } | undefined> {
|
async function createEmbedding (file: File): Promise<{ file: Ref<Blob>, type: string } | undefined> {
|
||||||
if (doc === undefined) {
|
if (doc === undefined) {
|
||||||
|
@ -34,9 +34,11 @@
|
|||||||
products.class.ProductVersion,
|
products.class.ProductVersion,
|
||||||
{ space: objectId },
|
{ space: objectId },
|
||||||
(res) => {
|
(res) => {
|
||||||
versions = res.length
|
versions = res.total
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
total: true,
|
||||||
|
limit: 1,
|
||||||
projection: { _id: 1 }
|
projection: { _id: 1 }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -30,9 +30,14 @@
|
|||||||
let applications: number
|
let applications: number
|
||||||
|
|
||||||
const query = createQuery()
|
const query = createQuery()
|
||||||
$: query.query(recruit.class.Applicant, { space: objectId }, (res) => {
|
$: query.query(
|
||||||
applications = res.length
|
recruit.class.Applicant,
|
||||||
})
|
{ space: objectId },
|
||||||
|
(res) => {
|
||||||
|
applications = res.total
|
||||||
|
},
|
||||||
|
{ total: true, limit: 1 }
|
||||||
|
)
|
||||||
|
|
||||||
const createApp = (ev: MouseEvent): void => {
|
const createApp = (ev: MouseEvent): void => {
|
||||||
showPopup(CreateApplication, { space: objectId, preserveVacancy: true }, ev.target as HTMLElement)
|
showPopup(CreateApplication, { space: objectId, preserveVacancy: true }, ev.target as HTMLElement)
|
||||||
|
@ -47,10 +47,12 @@
|
|||||||
core.class.TypedSpace,
|
core.class.TypedSpace,
|
||||||
{ type: type._id },
|
{ type: type._id },
|
||||||
(res) => {
|
(res) => {
|
||||||
spacesCount = res.length
|
spacesCount = res.total
|
||||||
loading = false
|
loading = false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
total: true,
|
||||||
|
limit: 1,
|
||||||
projection: { _id: 1 }
|
projection: { _id: 1 }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -71,9 +71,11 @@
|
|||||||
task.class.Task,
|
task.class.Task,
|
||||||
{ kind: taskType._id },
|
{ kind: taskType._id },
|
||||||
(res) => {
|
(res) => {
|
||||||
tasksCounter = res.length
|
tasksCounter = res.total
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
total: true,
|
||||||
|
limit: 1,
|
||||||
projection: {
|
projection: {
|
||||||
_id: 1
|
_id: 1
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
testManagement.class.TestCase,
|
testManagement.class.TestCase,
|
||||||
query,
|
query,
|
||||||
(res) => {
|
(res) => {
|
||||||
testCases = res.length
|
testCases = res.total
|
||||||
},
|
},
|
||||||
{ total: true, limit: 1 }
|
{ total: true, limit: 1 }
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user