diff options
Diffstat (limited to 'server/models/video/video-abuse.ts')
-rw-r--r-- | server/models/video/video-abuse.ts | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/server/models/video/video-abuse.ts b/server/models/video/video-abuse.ts index bc5f01e21..ab1a3ea7d 100644 --- a/server/models/video/video-abuse.ts +++ b/server/models/video/video-abuse.ts | |||
@@ -5,7 +5,6 @@ import { isVideoAbuseReporterUsernameValid, isVideoAbuseReasonValid } from '../. | |||
5 | 5 | ||
6 | import { addMethodsToModel, getSort } from '../utils' | 6 | import { addMethodsToModel, getSort } from '../utils' |
7 | import { | 7 | import { |
8 | VideoAbuseClass, | ||
9 | VideoAbuseInstance, | 8 | VideoAbuseInstance, |
10 | VideoAbuseAttributes, | 9 | VideoAbuseAttributes, |
11 | 10 | ||
@@ -109,7 +108,7 @@ function associate (models) { | |||
109 | }) | 108 | }) |
110 | } | 109 | } |
111 | 110 | ||
112 | listForApi = function (start: number, count: number, sort: string, callback: VideoAbuseMethods.ListForApiCallback) { | 111 | listForApi = function (start: number, count: number, sort: string) { |
113 | const query = { | 112 | const query = { |
114 | offset: start, | 113 | offset: start, |
115 | limit: count, | 114 | limit: count, |
@@ -122,11 +121,7 @@ listForApi = function (start: number, count: number, sort: string, callback: Vid | |||
122 | ] | 121 | ] |
123 | } | 122 | } |
124 | 123 | ||
125 | return VideoAbuse.findAndCountAll(query).asCallback(function (err, result) { | 124 | return VideoAbuse.findAndCountAll(query).then(({ rows, count }) => { |
126 | if (err) return callback(err) | 125 | return { total: count, data: rows } |
127 | |||
128 | return callback(null, result.rows, result.count) | ||
129 | }) | 126 | }) |
130 | } | 127 | } |
131 | |||
132 | |||