]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/search.ts
Stronger model typings
[github/Chocobozzz/PeerTube.git] / server / controllers / api / search.ts
index 9a1e30b8367f301fa3e9d2f111230c4152ee8046..7fef7c1732709bc3eef8fce8058fe2464a1c3cfe 100644 (file)
@@ -19,6 +19,7 @@ import { getOrCreateActorAndServerAndModel, getOrCreateVideoAndAccountAndChannel
 import { logger } from '../../helpers/logger'
 import { VideoChannelModel } from '../../models/video/video-channel'
 import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger'
+import { MChannelAccountDefault, MVideoAccountAllFiles } from '../../typings/models'
 
 const searchRouter = express.Router()
 
@@ -84,7 +85,7 @@ async function searchVideoChannelsDB (query: VideoChannelsSearchQuery, res: expr
 }
 
 async function searchVideoChannelURI (search: string, isWebfingerSearch: boolean, res: express.Response) {
-  let videoChannel: VideoChannelModel
+  let videoChannel: MChannelAccountDefault
   let uri = search
 
   if (isWebfingerSearch) {
@@ -137,7 +138,7 @@ async function searchVideosDB (query: VideosSearchQuery, res: express.Response)
 }
 
 async function searchVideoURI (url: string, res: express.Response) {
-  let video: VideoModel
+  let video: MVideoAccountAllFiles
 
   // Check if we can fetch a remote video with the URL
   if (isUserAbleToSearchRemoteURI(res)) {