diff options
Diffstat (limited to 'server/controllers/api/search.ts')
-rw-r--r-- | server/controllers/api/search.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts index 6e2d11d93..353fd171b 100644 --- a/server/controllers/api/search.ts +++ b/server/controllers/api/search.ts | |||
@@ -6,6 +6,7 @@ import { getOrCreateVideoAndAccountAndChannel } from '@server/lib/activitypub/vi | |||
6 | import { AccountBlocklistModel } from '@server/models/account/account-blocklist' | 6 | import { AccountBlocklistModel } from '@server/models/account/account-blocklist' |
7 | import { getServerActor } from '@server/models/application/application' | 7 | import { getServerActor } from '@server/models/application/application' |
8 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' | 8 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' |
9 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | ||
9 | import { ResultList, Video, VideoChannel } from '@shared/models' | 10 | import { ResultList, Video, VideoChannel } from '@shared/models' |
10 | import { SearchTargetQuery } from '@shared/models/search/search-target-query.model' | 11 | import { SearchTargetQuery } from '@shared/models/search/search-target-query.model' |
11 | import { VideoChannelsSearchQuery, VideosSearchQuery } from '../../../shared/models/search' | 12 | import { VideoChannelsSearchQuery, VideosSearchQuery } from '../../../shared/models/search' |
@@ -99,7 +100,7 @@ async function searchVideoChannelsIndex (query: VideoChannelsSearchQuery, res: e | |||
99 | } catch (err) { | 100 | } catch (err) { |
100 | logger.warn('Cannot use search index to make video channels search.', { err }) | 101 | logger.warn('Cannot use search index to make video channels search.', { err }) |
101 | 102 | ||
102 | return res.sendStatus(500) | 103 | return res.sendStatus(HttpStatusCode.INTERNAL_SERVER_ERROR_500) |
103 | } | 104 | } |
104 | } | 105 | } |
105 | 106 | ||
@@ -191,7 +192,7 @@ async function searchVideosIndex (query: VideosSearchQuery, res: express.Respons | |||
191 | } catch (err) { | 192 | } catch (err) { |
192 | logger.warn('Cannot use search index to make video search.', { err }) | 193 | logger.warn('Cannot use search index to make video search.', { err }) |
193 | 194 | ||
194 | return res.sendStatus(500) | 195 | return res.sendStatus(HttpStatusCode.INTERNAL_SERVER_ERROR_500) |
195 | } | 196 | } |
196 | } | 197 | } |
197 | 198 | ||