diff options
Diffstat (limited to 'shared/extra-utils/videos/video-comments.ts')
-rw-r--r-- | shared/extra-utils/videos/video-comments.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/shared/extra-utils/videos/video-comments.ts b/shared/extra-utils/videos/video-comments.ts index 81c48412d..831e5e7d4 100644 --- a/shared/extra-utils/videos/video-comments.ts +++ b/shared/extra-utils/videos/video-comments.ts | |||
@@ -61,6 +61,12 @@ function addVideoCommentReply ( | |||
61 | .expect(expectedStatus) | 61 | .expect(expectedStatus) |
62 | } | 62 | } |
63 | 63 | ||
64 | async function findCommentId (url: string, videoId: number | string, text: string) { | ||
65 | const res = await getVideoCommentThreads(url, videoId, 0, 25, '-createdAt') | ||
66 | |||
67 | return res.body.data.find(c => c.text === text).id as number | ||
68 | } | ||
69 | |||
64 | function deleteVideoComment ( | 70 | function deleteVideoComment ( |
65 | url: string, | 71 | url: string, |
66 | token: string, | 72 | token: string, |
@@ -85,5 +91,6 @@ export { | |||
85 | getVideoThreadComments, | 91 | getVideoThreadComments, |
86 | addVideoCommentThread, | 92 | addVideoCommentThread, |
87 | addVideoCommentReply, | 93 | addVideoCommentReply, |
94 | findCommentId, | ||
88 | deleteVideoComment | 95 | deleteVideoComment |
89 | } | 96 | } |