2021-08-27 14:32:44 +02:00
|
|
|
import express from 'express'
|
2021-06-03 17:33:44 +02:00
|
|
|
import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
|
2021-07-16 10:42:24 +02:00
|
|
|
import { HttpStatusCode } from '@shared/models'
|
2021-06-03 17:33:44 +02: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
|
|
|
|
}
|