import { addMethodsToModel, getSort } from '../utils'
import {
- VideoAbuseClass,
VideoAbuseInstance,
VideoAbuseAttributes,
})
}
-listForApi = function (start: number, count: number, sort: string, callback: VideoAbuseMethods.ListForApiCallback) {
+listForApi = function (start: number, count: number, sort: string) {
const query = {
offset: start,
limit: count,
]
}
- return VideoAbuse.findAndCountAll(query).asCallback(function (err, result) {
- if (err) return callback(err)
-
- return callback(null, result.rows, result.count)
+ return VideoAbuse.findAndCountAll(query).then(({ rows, count }) => {
+ return { total: count, data: rows }
})
}
-
-