diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-29 10:27:24 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-29 10:27:24 +0200 |
commit | b033851fb54241bb703f86add025229e68cc6f59 (patch) | |
tree | d60dac1499a95bf9dc902dee24f325fe0f8b6acb /shared/extra-utils/server | |
parent | fbd67e7f386504e50f2504cb6386700a58906f16 (diff) | |
download | PeerTube-b033851fb54241bb703f86add025229e68cc6f59.tar.gz PeerTube-b033851fb54241bb703f86add025229e68cc6f59.tar.zst PeerTube-b033851fb54241bb703f86add025229e68cc6f59.zip |
Search channels against handles and not names
Diffstat (limited to 'shared/extra-utils/server')
-rw-r--r-- | shared/extra-utils/server/follows-command.ts | 8 | ||||
-rw-r--r-- | shared/extra-utils/server/jobs-command.ts | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/shared/extra-utils/server/follows-command.ts b/shared/extra-utils/server/follows-command.ts index 2b889cf66..01ef6f179 100644 --- a/shared/extra-utils/server/follows-command.ts +++ b/shared/extra-utils/server/follows-command.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { pick } from 'lodash' | 1 | import { pick } from '@shared/core-utils' |
2 | import { ActivityPubActorType, ActorFollow, FollowState, HttpStatusCode, ResultList, ServerFollowCreate } from '@shared/models' | 2 | import { ActivityPubActorType, ActorFollow, FollowState, HttpStatusCode, ResultList, ServerFollowCreate } from '@shared/models' |
3 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | 3 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |
4 | import { PeerTubeServer } from './server' | 4 | import { PeerTubeServer } from './server' |
@@ -15,8 +15,7 @@ export class FollowsCommand extends AbstractCommand { | |||
15 | }) { | 15 | }) { |
16 | const path = '/api/v1/server/followers' | 16 | const path = '/api/v1/server/followers' |
17 | 17 | ||
18 | const toPick = [ 'start', 'count', 'sort', 'search', 'state', 'actorType' ] | 18 | const query = pick(options, [ 'start', 'count', 'sort', 'search', 'state', 'actorType' ]) |
19 | const query = pick(options, toPick) | ||
20 | 19 | ||
21 | return this.getRequestBody<ResultList<ActorFollow>>({ | 20 | return this.getRequestBody<ResultList<ActorFollow>>({ |
22 | ...options, | 21 | ...options, |
@@ -38,8 +37,7 @@ export class FollowsCommand extends AbstractCommand { | |||
38 | } = {}) { | 37 | } = {}) { |
39 | const path = '/api/v1/server/following' | 38 | const path = '/api/v1/server/following' |
40 | 39 | ||
41 | const toPick = [ 'start', 'count', 'sort', 'search', 'state', 'actorType' ] | 40 | const query = pick(options, [ 'start', 'count', 'sort', 'search', 'state', 'actorType' ]) |
42 | const query = pick(options, toPick) | ||
43 | 41 | ||
44 | return this.getRequestBody<ResultList<ActorFollow>>({ | 42 | return this.getRequestBody<ResultList<ActorFollow>>({ |
45 | ...options, | 43 | ...options, |
diff --git a/shared/extra-utils/server/jobs-command.ts b/shared/extra-utils/server/jobs-command.ts index 09a299e5b..c4eb12dc2 100644 --- a/shared/extra-utils/server/jobs-command.ts +++ b/shared/extra-utils/server/jobs-command.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { pick } from 'lodash' | 1 | import { pick } from '@shared/core-utils' |
2 | import { HttpStatusCode } from '@shared/models' | 2 | import { HttpStatusCode } from '@shared/models' |
3 | import { Job, JobState, JobType, ResultList } from '../../models' | 3 | import { Job, JobState, JobType, ResultList } from '../../models' |
4 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | 4 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |