Skip to content

Commit

Permalink
Merge pull request #200 from bcgov/qa
Browse files Browse the repository at this point in the history
Qa
  • Loading branch information
habibaz authored May 7, 2024
2 parents de30077 + 2b8ce12 commit 09bed7d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/helpers/GCNotifyCalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ const gCNotifyCaller = new GCNotifyCaller();
export function standardizeRole(role: string) {
let formattedRole: string = '';

if (role === 'Admin') {
formattedRole = 'Administrator';
} else if (role === 'SuperAdmin') {
if (role.toLowerCase() === 'Admin'.toLowerCase()) {
formattedRole = 'Supervisor';
} else if (role.toLowerCase() === 'SuperAdmin'.toLowerCase()) {
formattedRole = 'System administrator';
} else if (role === 'Standard') {
formattedRole = 'Client support';
} else if (role.toLowerCase() === 'Standard'.toLowerCase()) {
formattedRole = 'Customer support agent';
}

return formattedRole;
Expand Down
21 changes: 21 additions & 0 deletions src/migration/1713283059384-migration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class Migration1713283059384 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const schemaName = process.env.NODE_ENV === 'test' ? 'test' : 'public';
// create valid pid table
await queryRunner.query(`CREATE TABLE IF NOT EXISTS ${schemaName}."valid_pid" (
id UUID PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
pid INT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
const schemaName = process.env.NODE_ENV === 'test' ? 'test' : 'public';
// drop access_request table
await queryRunner.query(
`DROP TABLE IF EXISTS ${schemaName}."valid_pid"`,
);
}
}
2 changes: 1 addition & 1 deletion src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ router.get('/helloworld', async (req: Request, res: Response) => {
});

// Auth handling
const ONE_DAY = 30 * 60 * 1000; // 5 minutes
const ONE_DAY = 120 * 60 * 1000; // 5 minutes

router.get('/login', async (req, res) => {
try {
Expand Down

0 comments on commit 09bed7d

Please sign in to comment.