sonic: fix imvalid limit error

pull/122/head
undefined 3 years ago
parent 6924875ec9
commit 23880f11fa

@ -22,6 +22,6 @@ bus.on('problem/del', async (domainId, docId) => {
global.Hydro.lib.problemSearch = async (domainId: string, query: string) => {
const c = system.get('pagination.problem');
const docIds = await sonic.query('problem', `${domainId}@title`, query, { limit: c });
docIds.push(...await sonic.query('problem', `${domainId}@content`, query, { limit: c - docIds.length }));
if (c - docIds.length > 0) docIds.push(...await sonic.query('problem', `${domainId}@content`, query, { limit: c - docIds.length }));
return docIds.map(Number);
};

@ -1,6 +1,6 @@
{
"name": "@hydrooj/sonic",
"version": "1.0.2",
"version": "1.0.3",
"description": "Sonic search service",
"main": "service.js",
"typings": "service.d.ts",

Loading…
Cancel
Save