"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.doesChangeVideoOwnershipExist = void 0;
const tslib_1 = require("tslib");
const video_change_ownership_1 = require("../../../models/video/video-change-ownership");
const core_utils_1 = require("../../../../shared/core-utils");
function doesChangeVideoOwnershipExist(idArg, res) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const id = (0, core_utils_1.forceNumber)(idArg);
        const videoChangeOwnership = yield video_change_ownership_1.VideoChangeOwnershipModel.load(id);
        if (!videoChangeOwnership) {
            res.fail({
                status: 404,
                message: 'Video change ownership not found'
            });
            return false;
        }
        res.locals.videoChangeOwnership = videoChangeOwnership;
        return true;
    });
}
exports.doesChangeVideoOwnershipExist = doesChangeVideoOwnershipExist;
//# sourceMappingURL=video-ownerships.js.map