2021-06-03 11:33:44 -04:00
|
|
|
import * as express from 'express'
|
|
|
|
import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
|
2021-07-16 04:42:24 -04:00
|
|
|
import { HttpStatusCode } from '@shared/models'
|
2021-06-03 11:33:44 -04:00
|
|
|
|
|
|
|
async function doesChangeVideoOwnershipExist (idArg: number | string, res: express.Response) {
|
|
|
|
const id = parseInt(idArg + '', 10)
|
|
|
|
const videoChangeOwnership = await VideoChangeOwnershipModel.load(id)
|
|
|
|
|
|
|
|
if (!videoChangeOwnership) {
|
|
|
|
res.fail({
|
|
|
|
status: HttpStatusCode.NOT_FOUND_404,
|
|
|
|
message: 'Video change ownership not found'
|
|
|
|
})
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
res.locals.videoChangeOwnership = videoChangeOwnership
|
|
|
|
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
|
|
|
doesChangeVideoOwnershipExist
|
|
|
|
}
|