aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-03 15:53:07 +0200
committerChocobozzz <me@florianbigard.com>2021-05-03 16:42:15 +0200
commit1a7d0887b6c22ca6539a15297fd4159d33d7dc48 (patch)
treea6a7c0c55ab0c8af74bb5df7baef13c10cc3ef64 /client/src/app/shared
parent1de8740195bedd0d3d43acf69f443f27364e39ce (diff)
downloadPeerTube-1a7d0887b6c22ca6539a15297fd4159d33d7dc48.tar.gz
PeerTube-1a7d0887b6c22ca6539a15297fd4159d33d7dc48.tar.zst
PeerTube-1a7d0887b6c22ca6539a15297fd4159d33d7dc48.zip
Refactor parseQueryStringFilter boolean handler
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts8
-rw-r--r--client/src/app/shared/shared-video-comment/video-comment.service.ts8
2 files changed, 2 insertions, 14 deletions
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index 668e51f73..7b17bd2ab 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -129,13 +129,7 @@ export class VideoService implements VideosProvider {
129 const filters = this.restService.parseQueryStringFilter(search, { 129 const filters = this.restService.parseQueryStringFilter(search, {
130 isLive: { 130 isLive: {
131 prefix: 'isLive:', 131 prefix: 'isLive:',
132 isBoolean: true, 132 isBoolean: true
133 handler: v => {
134 if (v === 'true') return v
135 if (v === 'false') return v
136
137 return undefined
138 }
139 } 133 }
140 }) 134 })
141 135
diff --git a/client/src/app/shared/shared-video-comment/video-comment.service.ts b/client/src/app/shared/shared-video-comment/video-comment.service.ts
index 0f09778df..c5aeb3c12 100644
--- a/client/src/app/shared/shared-video-comment/video-comment.service.ts
+++ b/client/src/app/shared/shared-video-comment/video-comment.service.ts
@@ -190,13 +190,7 @@ export class VideoCommentService {
190 const filters = this.restService.parseQueryStringFilter(search, { 190 const filters = this.restService.parseQueryStringFilter(search, {
191 isLocal: { 191 isLocal: {
192 prefix: 'local:', 192 prefix: 'local:',
193 isBoolean: true, 193 isBoolean: true
194 handler: v => {
195 if (v === 'true') return v
196 if (v === 'false') return v
197
198 return undefined
199 }
200 }, 194 },
201 195
202 searchAccount: { prefix: 'account:' }, 196 searchAccount: { prefix: 'account:' },