video-channel-syncs.ts 629 B

123456789101112131415161718192021222324
  1. import express from 'express'
  2. import { VideoChannelSyncModel } from '@server/models/video/video-channel-sync'
  3. import { HttpStatusCode } from '@shared/models'
  4. async function doesVideoChannelSyncIdExist (id: number, res: express.Response) {
  5. const sync = await VideoChannelSyncModel.loadWithChannel(+id)
  6. if (!sync) {
  7. res.fail({
  8. status: HttpStatusCode.NOT_FOUND_404,
  9. message: 'Video channel sync not found'
  10. })
  11. return false
  12. }
  13. res.locals.videoChannelSync = sync
  14. return true
  15. }
  16. // ---------------------------------------------------------------------------
  17. export {
  18. doesVideoChannelSyncIdExist
  19. }