mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: problemsearch: fix '%' as keyword
This commit is contained in:
1 parent
34b0cc4d14
commit
45c6773513
2 files changed
+3
-3
No files matched your search
@@ -148,7 +148,7 @@ export class ProblemMainHandler extends Handler {
|
|||||||
let sort: string[];
|
let sort: string[];
|
||||||
let fail = false;
|
let fail = false;
|
||||||
let pcountRelation = 'eq';
|
let pcountRelation = 'eq';
|
||||||
const category = flattenDeep(decodeURIComponent(q).split(' ')
|
const category = flattenDeep(q.split(' ')
|
||||||
.filter((i) => i.startsWith('category:'))
|
.filter((i) => i.startsWith('category:'))
|
||||||
.map((i) => i.split('category:')[1]?.split(',')));
|
.map((i) => i.split('category:')[1]?.split(',')));
|
||||||
const text = q.split(' ').filter((i) => !i.startsWith('category:')).join(' ');
|
const text = q.split(' ').filter((i) => !i.startsWith('category:')).join(' ');
|
||||||
@@ -294,7 +294,7 @@ export class ProblemMainHandler extends Handler {
|
|||||||
export class ProblemRandomHandler extends Handler {
|
export class ProblemRandomHandler extends Handler {
|
||||||
@param('q', Types.Content, true)
|
@param('q', Types.Content, true)
|
||||||
async get(domainId: string, qs = '') {
|
async get(domainId: string, qs = '') {
|
||||||
const category = flattenDeep(decodeURIComponent(qs).split(' ')
|
const category = flattenDeep(qs.split(' ')
|
||||||
.filter((i) => i.startsWith('category:'))
|
.filter((i) => i.startsWith('category:'))
|
||||||
.map((i) => i.split('category:')[1]?.split(',')));
|
.map((i) => i.split('category:')[1]?.split(',')));
|
||||||
const q = buildQuery(this.user);
|
const q = buildQuery(this.user);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export default new AutoloadPage('omnibar', () => {
|
|||||||
}
|
}
|
||||||
setSearching?.(true);
|
setSearching?.(true);
|
||||||
[{ pdocs, psdict }, udocs] = await Promise.all([
|
[{ pdocs, psdict }, udocs] = await Promise.all([
|
||||||
request.get(`/d/${UiContext.domainId}/p?q=${encodeURIComponent(query)}&limit=10`),
|
request.get(`/d/${UiContext.domainId}/p`, { q: query, limit: 10 }),
|
||||||
api(gql`
|
api(gql`
|
||||||
users(search: ${query}) {
|
users(search: ${query}) {
|
||||||
_id
|
_id
|
||||||
|
|||||||
Reference in new issue
Block a user