From 231ff4af3bdb864d6bc66e487b12275e5f1fb44f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 2 Nov 2021 11:50:03 +0100 Subject: Add ability to exclude muted accounts --- client/src/app/core/rest/rest.service.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'client/src/app/core') diff --git a/client/src/app/core/rest/rest.service.ts b/client/src/app/core/rest/rest.service.ts index 93b5f56b2..59152e658 100644 --- a/client/src/app/core/rest/rest.service.ts +++ b/client/src/app/core/rest/rest.service.ts @@ -1,13 +1,16 @@ +import * as debug from 'debug' import { SortMeta } from 'primeng/api' import { HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { ComponentPaginationLight } from './component-pagination.model' import { RestPagination } from './rest-pagination' +const logger = debug('peertube:rest') + interface QueryStringFilterPrefixes { [key: string]: { prefix: string - handler?: (v: string) => string | number + handler?: (v: string) => string | number | boolean multiple?: boolean isBoolean?: boolean } @@ -87,6 +90,8 @@ export class RestService { const prefixeStrings = Object.values(prefixes) .map(p => p.prefix) + logger(`Built tokens "${tokens.join(', ')}" for prefixes "${prefixeStrings.join(', ')}"`) + // Search is the querystring minus defined filters const searchTokens = tokens.filter(t => { return prefixeStrings.every(prefixString => t.startsWith(prefixString) === false) @@ -122,8 +127,12 @@ export class RestService { : matchedTokens[0] } + const search = searchTokens.join(' ') || undefined + + logger('Built search: ' + search, additionalFilters) + return { - search: searchTokens.join(' ') || undefined, + search, ...additionalFilters } -- cgit v1.2.3