Skip to content

Commit

Permalink
fix: hard-code Idox Nexus organisation names (#3541)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Aug 21, 2024
1 parent 602c4c9 commit 259b74f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions api.planx.uk/modules/send/idox/nexus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface RawIdoxNexusAuthResponse {

interface IdoxNexusAuthResponse {
token: string;
organisations: Record<string, string>;
organisations: Record<number, string>;
authorities: string[];
}

Expand Down Expand Up @@ -90,7 +90,14 @@ export async function sendToIdoxNexus(
// Switch to `team_integrations`-based approach later
const orgIds = Object.keys(organisations);
const randomOrgId = orgIds[Math.floor(Math.random() * orgIds.length)];
const randomOrg = organisations[randomOrgId];
// Dev auth endpoint returns "Multi-organisation" as every org name, but Idox expects these (OSL typo is "correct")
const orgNamesMap: Record<string, string> = {
"210051": "Open System Labs 001",
"210052": "Open System Labs 002",
"210053": "Open System Labs 003",
"210054": "Open System Labs 004",
};
const randomOrg = orgNamesMap[randomOrgId];

// Create a zip containing only the ODP Schema JSON
// Do this BEFORE creating a submission in order to throw any validation errors early
Expand Down

0 comments on commit 259b74f

Please sign in to comment.