mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
Implement enum for report reason categories after Matts suggestion
This commit is contained in:
parent
19facb22a9
commit
6365d3df54
@ -1,6 +1,6 @@
|
||||
export default {
|
||||
Mutation: {
|
||||
report: async (_parent, params, { driver, _req, user }, _resolveInfo) => {
|
||||
report: async (_parent, params, { driver, user }, _resolveInfo) => {
|
||||
const { resourceId, reasonCategory, reasonDescription } = params
|
||||
|
||||
const session = driver.session()
|
||||
@ -85,7 +85,7 @@ export default {
|
||||
},
|
||||
},
|
||||
Query: {
|
||||
reports: async (_parent, _params, { driver, _req, _user }, _resolveInfo) => {
|
||||
reports: async (_parent, _params, { driver }, _resolveInfo) => {
|
||||
const session = driver.session()
|
||||
const res = await session.run(
|
||||
`
|
||||
@ -113,7 +113,6 @@ export default {
|
||||
|
||||
const responseEle = {
|
||||
...report.properties,
|
||||
resource: resource.properties,
|
||||
resourceId: resource.properties.id,
|
||||
post: null,
|
||||
comment: null,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
type REPORTED {
|
||||
createdAt: String
|
||||
reasonCategory: String
|
||||
reasonCategory: ReasonCategory
|
||||
reasonDescription: String
|
||||
submitter: User
|
||||
@cypher(statement: "MATCH (resource)<-[:REPORTED]-(user:User) RETURN user")
|
||||
@ -16,6 +16,18 @@ type REPORTED {
|
||||
comment: Comment
|
||||
}
|
||||
|
||||
# list see "reportReasonCategoriesDatabaseList" in shared file "shared/moderation/report.js"
|
||||
enum ReasonCategory {
|
||||
other
|
||||
discrimination-etc
|
||||
pornographic-content-links
|
||||
glorific-trivia-of-cruel-inhuman-acts
|
||||
doxing
|
||||
intentional-intimidation-stalking-persecution
|
||||
advert-products-services-commercial
|
||||
criminal-behavior-violation-german-law
|
||||
}
|
||||
|
||||
# not yet supported
|
||||
# union ReportReource = User | Post | Comment
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
export const reportReasonCategoriesDatabaseList = () => {
|
||||
// list see "ReasonCategory" in backend GraphQL schema file "REPORTED.gql"
|
||||
return [
|
||||
'other', // element # zero, because it is the nutral one
|
||||
'discrimination-etc',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user