-
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.
move around dsareport mutation/services/etc
- Loading branch information
Showing
8 changed files
with
56 additions
and
40 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import GraphContext from "coral-server/graph/context"; | ||
import { createDSAReport } from "coral-server/services/dsaReports/reports"; | ||
|
||
import { GQLCreateDSAReportInput } from "coral-server/graph/schema/__generated__/types"; | ||
|
||
export const DSAReports = (ctx: GraphContext) => ({ | ||
createDSAReport: ({ | ||
commentID, | ||
userID, | ||
lawBrokenDescription, | ||
additionalInformation, | ||
submissionID, | ||
}: GQLCreateDSAReportInput) => | ||
createDSAReport(ctx.mongo, ctx.tenant, { | ||
commentID, | ||
userID, | ||
lawBrokenDescription, | ||
additionalInformation, | ||
submissionID, | ||
}), | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { MongoContext } from "coral-server/data/context"; | ||
import { createDSAReport as createReport } from "coral-server/models/dsaReport/report"; | ||
import { Tenant } from "coral-server/models/tenant"; | ||
|
||
export interface CreateDSAReportInput { | ||
commentID: string; | ||
userID: string; | ||
lawBrokenDescription: string; | ||
additionalInformation: string; | ||
submissionID?: string; | ||
} | ||
|
||
export async function createDSAReport( | ||
mongo: MongoContext, | ||
tenant: Tenant, | ||
input: CreateDSAReportInput, | ||
now = new Date() | ||
) { | ||
const result = await createReport(mongo, tenant.id, input, now); | ||
const { dsaReport } = result; | ||
return dsaReport; | ||
} |