2020-02-18 08:57:00 +01:00
|
|
|
import gql from "graphql-tag";
|
2021-10-29 10:54:35 +02:00
|
|
|
import { ACTOR_FRAGMENT } from "./actor";
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
export const REPORTS = gql`
|
2022-01-10 10:17:50 +01:00
|
|
|
query Reports(
|
|
|
|
$status: ReportStatus
|
|
|
|
$domain: String
|
|
|
|
$page: Int
|
|
|
|
$limit: Int
|
|
|
|
) {
|
|
|
|
reports(status: $status, domain: $domain, page: $page, limit: $limit) {
|
2021-05-12 18:10:07 +02:00
|
|
|
total
|
|
|
|
elements {
|
2020-02-18 08:57:00 +01:00
|
|
|
id
|
2021-05-12 18:10:07 +02:00
|
|
|
reported {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2021-05-12 18:10:07 +02:00
|
|
|
reporter {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2021-05-12 18:10:07 +02:00
|
|
|
event {
|
2020-02-18 08:57:00 +01:00
|
|
|
id
|
2021-05-12 18:10:07 +02:00
|
|
|
uuid
|
|
|
|
title
|
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2021-05-12 18:10:07 +02:00
|
|
|
status
|
|
|
|
content
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2021-10-29 10:54:35 +02:00
|
|
|
${ACTOR_FRAGMENT}
|
2019-09-09 09:31:08 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
const REPORT_FRAGMENT = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
fragment ReportFragment on Report {
|
|
|
|
id
|
|
|
|
reported {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
reporter {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
event {
|
|
|
|
id
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
description
|
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
comments {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
actor {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
notes {
|
|
|
|
id
|
|
|
|
content
|
|
|
|
moderator {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
insertedAt
|
|
|
|
}
|
|
|
|
insertedAt
|
|
|
|
updatedAt
|
|
|
|
status
|
|
|
|
content
|
|
|
|
}
|
2021-10-29 10:54:35 +02:00
|
|
|
${ACTOR_FRAGMENT}
|
2019-09-09 09:31:08 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const REPORT = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
query Report($id: ID!) {
|
|
|
|
report(id: $id) {
|
|
|
|
...ReportFragment
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${REPORT_FRAGMENT}
|
2019-09-09 09:31:08 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_REPORT = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
mutation CreateReport(
|
2020-09-30 15:25:30 +02:00
|
|
|
$eventId: ID
|
2020-02-18 08:57:00 +01:00
|
|
|
$reportedId: ID!
|
|
|
|
$content: String
|
|
|
|
$commentsIds: [ID]
|
|
|
|
$forward: Boolean
|
|
|
|
) {
|
|
|
|
createReport(
|
|
|
|
eventId: $eventId
|
|
|
|
reportedId: $reportedId
|
|
|
|
content: $content
|
|
|
|
commentsIds: $commentsIds
|
|
|
|
forward: $forward
|
2019-09-09 09:31:08 +02:00
|
|
|
) {
|
2020-02-18 08:57:00 +01:00
|
|
|
id
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
`;
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
export const UPDATE_REPORT = gql`
|
2020-11-19 17:06:28 +01:00
|
|
|
mutation UpdateReport($reportId: ID!, $status: ReportStatus!) {
|
|
|
|
updateReportStatus(reportId: $reportId, status: $status) {
|
2020-02-18 08:57:00 +01:00
|
|
|
...ReportFragment
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${REPORT_FRAGMENT}
|
2019-09-09 09:31:08 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_REPORT_NOTE = gql`
|
2020-11-19 17:06:28 +01:00
|
|
|
mutation CreateReportNote($reportId: ID!, $content: String!) {
|
|
|
|
createReportNote(reportId: $reportId, content: $content) {
|
2020-02-18 08:57:00 +01:00
|
|
|
id
|
|
|
|
content
|
|
|
|
insertedAt
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
`;
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
export const LOGS = gql`
|
2021-04-27 17:53:11 +02:00
|
|
|
query ActionLogs($page: Int, $limit: Int) {
|
|
|
|
actionLogs(page: $page, limit: $limit) {
|
|
|
|
elements {
|
2020-02-18 08:57:00 +01:00
|
|
|
id
|
2021-04-27 17:53:11 +02:00
|
|
|
action
|
|
|
|
actor {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2021-04-27 16:51:28 +02:00
|
|
|
}
|
2021-04-27 17:53:11 +02:00
|
|
|
object {
|
|
|
|
... on Report {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
... on ReportNote {
|
|
|
|
report {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
... on Event {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
}
|
2021-04-28 11:59:15 +02:00
|
|
|
... on Comment {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
event {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
uuid
|
|
|
|
}
|
|
|
|
actor {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2021-04-28 11:59:15 +02:00
|
|
|
}
|
|
|
|
}
|
2021-04-27 17:53:11 +02:00
|
|
|
... on Person {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2021-04-27 17:53:11 +02:00
|
|
|
}
|
|
|
|
... on Group {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2021-04-27 17:53:11 +02:00
|
|
|
}
|
|
|
|
... on User {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
confirmedAt
|
|
|
|
}
|
2020-06-15 19:41:11 +02:00
|
|
|
}
|
2021-04-27 17:53:11 +02:00
|
|
|
insertedAt
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2021-04-27 17:53:11 +02:00
|
|
|
total
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2021-10-29 10:54:35 +02:00
|
|
|
${ACTOR_FRAGMENT}
|
2020-02-18 08:57:00 +01:00
|
|
|
`;
|