generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from bcgov/add-frontend-api
Add frontend api
- Loading branch information
Showing
15 changed files
with
318 additions
and
169 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export enum Role { | ||
ENMODS_USER = 'Enmods user', | ||
ENMODS_ADMIN = 'Enmods admin' | ||
} | ||
ENMODS_USER = "Enmods User", | ||
ENMODS_ADMIN = "Enmods Admin", | ||
} |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import {NestExpressApplication} from "@nestjs/platform-express"; | ||
import {bootstrap} from "./app"; | ||
import {Logger} from "@nestjs/common"; | ||
import { NestExpressApplication } from "@nestjs/platform-express"; | ||
import { bootstrap } from "./app"; | ||
import { Logger } from "@nestjs/common"; | ||
|
||
const logger = new Logger('NestApplication'); | ||
bootstrap().then(async (app: NestExpressApplication) => { | ||
await app.listen(3000); | ||
logger.log(`Listening on ${await app.getUrl()}`); | ||
}).catch(err=>{ | ||
logger.error(err); | ||
}); | ||
const logger = new Logger("NestApplication"); | ||
bootstrap() | ||
.then(async (app: NestExpressApplication) => { | ||
await app.listen(3000); | ||
logger.log(`Listening on ${await app.getUrl()}`); | ||
}) | ||
.catch((err) => { | ||
logger.error(err); | ||
}); |
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,25 @@ | ||
/** | ||
* Type of data returned by CSS user api | ||
*/ | ||
export type IdirUserInfo = { | ||
username: string; | ||
email: string; | ||
firstName: string; | ||
lastName: string; | ||
attributes: { | ||
idir_user_guid: string[]; | ||
idir_username: string[]; | ||
display_name: string[]; | ||
}; | ||
}; | ||
|
||
/** | ||
* Type returned to the frontend for displaying users on Admin page | ||
*/ | ||
export type UserInfo = { | ||
username: string; | ||
email: string; | ||
name: string; | ||
company: string; | ||
role: string[]; | ||
}; |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
import type { UserInfo } from '@/types/types' | ||
import config from '../config' | ||
import * as api from './api' | ||
|
||
export async function getUsers(): Promise<UserInfo[]> { | ||
const adminDataUrl: string = `${config.API_BASE_URL}/admin` | ||
const getParameters = api.generateApiParameters(adminDataUrl) | ||
const adminData: UserInfo[] = await api.get(getParameters) | ||
return adminData | ||
} |
Oops, something went wrong.