]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/middlewares/validators/shared/video-channel-syncs.ts
Merge branch 'release/5.0.0' into develop
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / shared / video-channel-syncs.ts
1 import express from 'express'
2 import { VideoChannelSyncModel } from '@server/models/video/video-channel-sync'
3 import { HttpStatusCode } from '@shared/models'
4
5 async function doesVideoChannelSyncIdExist (id: number, res: express.Response) {
6 const sync = await VideoChannelSyncModel.loadWithChannel(+id)
7
8 if (!sync) {
9 res.fail({
10 status: HttpStatusCode.NOT_FOUND_404,
11 message: 'Video channel sync not found'
12 })
13 return false
14 }
15
16 res.locals.videoChannelSync = sync
17 return true
18 }
19
20 // ---------------------------------------------------------------------------
21
22 export {
23 doesVideoChannelSyncIdExist
24 }