Skip to content

Commit

Permalink
Update staging segment names to use underscores.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhochbaum-dcp committed Dec 16, 2024
1 parent 85d9bf1 commit 4b49e71
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/src/send-update/send-update.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ export class SendUpdateController {
const project = await this.projectService.findOneByName(params.id);
// If no project is found, projectService returns HTTP error automatically, and this function does not continue

// Production names use underscores, staging use dashes
var segments = project["data"]["attributes"]["dcp-borough"] === "Citywide" ? [{ name: "CW", envSegment: `zap${this.sendgridEnvironment === "production" ? "_production_" : "-staging-"}CW`, segmentId: "" }] : [];
var segments = project["data"]["attributes"]["dcp-borough"] === "Citywide" ? [{ name: "CW", envSegment: `zap${this.sendgridEnvironment === "production" ? "_production_" : "_staging_"}CW`, segmentId: "" }] : [];

if(project["data"]["attributes"]["dcp-validatedcommunitydistricts"]) {
project["data"]["attributes"]["dcp-validatedcommunitydistricts"].split(",").forEach(element => {
segments.push({ name: element, envSegment: `zap${this.sendgridEnvironment === "production" ? "_production_" : "-staging-"}${element}`, segmentId: "" })
segments.push({ name: element, envSegment: `zap${this.sendgridEnvironment === "production" ? "_production_" : "_staging_"}${element}`, segmentId: "" })
});
}

Expand Down

0 comments on commit 4b49e71

Please sign in to comment.