-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add create dsareport mutation, services, schema; plus some validation
- Loading branch information
Showing
11 changed files
with
335 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...src/core/client/stream/tabs/Comments/IllegalContentReportView/CreateDSAReportMutation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { graphql } from "react-relay"; | ||
import { Environment } from "relay-runtime"; | ||
|
||
import { | ||
commitMutationPromiseNormalized, | ||
createMutation, | ||
MutationInput, | ||
} from "coral-framework/lib/relay"; | ||
|
||
import { CreateDSAReportMutation as MutationTypes } from "coral-stream/__generated__/CreateDSAReportMutation.graphql"; | ||
|
||
let clientMutationId = 0; | ||
|
||
const CreateDSAReportMutation = createMutation( | ||
"createDSAReport", | ||
(environment: Environment, input: MutationInput<MutationTypes>) => { | ||
const result = commitMutationPromiseNormalized<MutationTypes>(environment, { | ||
mutation: graphql` | ||
mutation CreateDSAReportMutation($input: CreateDSAReportInput!) { | ||
createDSAReport(input: $input) { | ||
dsaReport { | ||
id | ||
lawBrokenDescription | ||
} | ||
clientMutationId | ||
} | ||
} | ||
`, | ||
variables: { | ||
input: { | ||
userID: input.userID, | ||
commentID: input.commentID, | ||
lawBrokenDescription: input.lawBrokenDescription, | ||
additionalInformation: input.additionalInformation, | ||
submissionID: input.submissionID, | ||
clientMutationId: (clientMutationId++).toString(), | ||
}, | ||
}, | ||
}); | ||
return result; | ||
} | ||
); | ||
|
||
export default CreateDSAReportMutation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.