- static load (id: number, t?: Sequelize.Transaction) {
- return VideoModel.findById(id, { transaction: t })
+ static load (id: number | string, t?: Sequelize.Transaction) {
+ const where = VideoModel.buildWhereIdOrUUID(id)
+ const options = {
+ where,
+ transaction: t
+ }
+
+ return VideoModel.findOne(options)
+ }
+
+ static loadOnlyId (id: number | string, t?: Sequelize.Transaction) {
+ const where = VideoModel.buildWhereIdOrUUID(id)
+
+ const options = {
+ attributes: [ 'id' ],
+ where,
+ transaction: t
+ }
+
+ return VideoModel.findOne(options)