Skip to content

Commit

Permalink
Merge branch 'golden-eagle' into feat/CE-772
Browse files Browse the repository at this point in the history
  • Loading branch information
afwilcox authored Jul 4, 2024
2 parents 55cd5f7 + bdd876d commit 1331212
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"date-fns": "^3.6.0",
"date-fns-tz": "^3.1.3",
"dotenv": "^16.0.1",
"escape-html": "^1.0.3",
"form-data": "^4.0.0",
"geojson": "^0.5.0",
"jest-mock": "^29.6.1",
Expand Down
5 changes: 2 additions & 3 deletions backend/src/v1/document/document.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Roles } from "../../auth/decorators/roles.decorator";
import { Token } from "../../auth/decorators/token.decorator";
import { COMPLAINT_TYPE } from "../../types/models/complaints/complaint-type";
import { format } from "date-fns";
import { escape } from "escape-html";

@UseGuards(JwtRoleGuard)
@ApiTags("document")
Expand All @@ -27,8 +28,6 @@ export class DocumentController {
@Res() res: Response,
): Promise<void> {
try {
this.logger.debug("TIMEZONE: ", tz);

const fileName = `Complaint-${id}-${type}-${format(new Date(), "yyyy-MM-dd")}.pdf`;
const response = await this.service.exportComplaint(id, type, fileName, tz);

Expand All @@ -47,7 +46,7 @@ export class DocumentController {
res.end(buffer);
} catch (error) {
this.logger.error(`exception: unable to export document for complaint: ${id} - error: ${error}`);
res.status(500).send(`exception: unable to export document for complaint: ${id} - error: ${error}`);
res.status(500).send(`exception: unable to export document for complaint: ${escape(id)}`);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const LeafletMapWithMultiplePoints: React.FC<MapProps> = ({ complaintType, marke
const bannerType = unmappedComplaints >= 1 ? "unmapped" : "no-results";
const info =
unmappedComplaints >= 1
? `The exact location of ${unmappedComplaints} complaint${isPluralized} could not be determined.`
? `${unmappedComplaints} complaint${isPluralized} could not be mapped`
: "No complaints found.";

return (
Expand Down

0 comments on commit 1331212

Please sign in to comment.