|
@@ -181,10 +181,7 @@ export class ReportsInfosResolver {
|
|
|
|
|
|
@Query(() => [VideoReportInfo])
|
|
@Query(() => [VideoReportInfo])
|
|
@Authorized()
|
|
@Authorized()
|
|
- async reportedVideos(
|
|
|
|
- @Args() { orderBy, where, limit, skip }: VideoReportsArgs,
|
|
|
|
- @Ctx() ctx: OrionContext
|
|
|
|
- ): Promise<VideoReportInfo[]> {
|
|
|
|
|
|
+ async reportedVideos(@Args() { orderBy, where, limit, skip }: VideoReportsArgs): Promise<VideoReportInfo[]> {
|
|
const reportedVideosDocument = await ReportedVideoModel.find({
|
|
const reportedVideosDocument = await ReportedVideoModel.find({
|
|
...(where?.videoId ? { videoId: where?.videoId } : {}),
|
|
...(where?.videoId ? { videoId: where?.videoId } : {}),
|
|
...(where?.createdAt_gt ? { timestamp: { $gte: where.createdAt_gt } } : {}),
|
|
...(where?.createdAt_gt ? { timestamp: { $gte: where.createdAt_gt } } : {}),
|
|
@@ -201,16 +198,13 @@ export class ReportsInfosResolver {
|
|
videoId: reportedVideo.videoId,
|
|
videoId: reportedVideo.videoId,
|
|
createdAt: reportedVideo.timestamp,
|
|
createdAt: reportedVideo.timestamp,
|
|
id: reportedVideo.id,
|
|
id: reportedVideo.id,
|
|
- reporterIp: ctx.remoteHost || '',
|
|
|
|
|
|
+ reporterIp: reportedVideo.reporterIp,
|
|
})) || []
|
|
})) || []
|
|
)
|
|
)
|
|
}
|
|
}
|
|
@Query(() => [ChannelReportInfo])
|
|
@Query(() => [ChannelReportInfo])
|
|
@Authorized()
|
|
@Authorized()
|
|
- async reportedChannels(
|
|
|
|
- @Args() { orderBy, where, limit, skip }: ChannelReportsArgs,
|
|
|
|
- @Ctx() ctx: OrionContext
|
|
|
|
- ): Promise<ChannelReportInfo[]> {
|
|
|
|
|
|
+ async reportedChannels(@Args() { orderBy, where, limit, skip }: ChannelReportsArgs): Promise<ChannelReportInfo[]> {
|
|
const reportedChannelsDocument = await ReportedChannelModel.find({
|
|
const reportedChannelsDocument = await ReportedChannelModel.find({
|
|
...(where?.channelId ? { channelId: where?.channelId } : {}),
|
|
...(where?.channelId ? { channelId: where?.channelId } : {}),
|
|
...(where?.createdAt_gt ? { timestamp: { $gte: where.createdAt_gt } } : {}),
|
|
...(where?.createdAt_gt ? { timestamp: { $gte: where.createdAt_gt } } : {}),
|
|
@@ -227,7 +221,7 @@ export class ReportsInfosResolver {
|
|
channelId: reportedChannel.channelId,
|
|
channelId: reportedChannel.channelId,
|
|
createdAt: reportedChannel.timestamp,
|
|
createdAt: reportedChannel.timestamp,
|
|
id: reportedChannel.id,
|
|
id: reportedChannel.id,
|
|
- reporterIp: ctx.remoteHost || '',
|
|
|
|
|
|
+ reporterIp: reportedChannel.reporterIp,
|
|
})) || []
|
|
})) || []
|
|
)
|
|
)
|
|
}
|
|
}
|