Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BEDS-97/add-flag-mock-data #977

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions frontend/.env-example
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
NUXT_PUBLIC_API_CLIENT: ""
NUXT_PUBLIC_LEGACY_API_CLIENT: ""
NUXT_PRIVATE_API_SERVER: ""
NUXT_PRIVATE_LEGACY_API_SERVER: ""
NUXT_PUBLIC_API_KEY: ""
NUXT_PUBLIC_DOMAIN: ""
NUXT_PUBLIC_STRIPE_BASE_URL: ""
NUXT_PUBLIC_LOG_IP: ""
NUXT_PUBLIC_SHOW_IN_DEVELOPMENT: ""
NUXT_PUBLIC_V1_DOMAIN: ""
NUXT_PUBLIC_LOG_FILE: ""
NUXT_PUBLIC_CHAIN_ID_BY_DEFAULT: ""
NUXT_PUBLIC_MAINTENANCE_TS: "1717700652"
NUXT_PUBLIC_DEPLOYMENT_TYPE: "development"
PRIVATE_SSR_SECRET: ""
NUXT_IS_API_MOCKED=
NUXT_PRIVATE_API_SERVER=
NUXT_PRIVATE_LEGACY_API_SERVER=
NUXT_PUBLIC_API_CLIENT=
NUXT_PUBLIC_API_KEY=
NUXT_PUBLIC_CHAIN_ID_BY_DEFAULT=
NUXT_PUBLIC_DEPLOYMENT_TYPE=development
NUXT_PUBLIC_DOMAIN=
NUXT_PUBLIC_LEGACY_API_CLIENT=
NUXT_PUBLIC_LOG_FILE=
NUXT_PUBLIC_LOG_IP=
NUXT_PUBLIC_MAINTENANCE_TS=1717700652
NUXT_PUBLIC_SHOW_IN_DEVELOPMENT=
NUXT_PUBLIC_STRIPE_BASE_URL=
NUXT_PUBLIC_V1_DOMAIN=
PRIVATE_SSR_SECRET=
8 changes: 8 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ bun run preview

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

## Get mocked api data

If your `user` was added to the `ADMIN` or `DEV` group by the `api team`, you can get
`mocked data` from the `api` for certain `endpoints` by adding `?is_mocked=true` as a
`query parameter`.

You can `turn on` mocked data `globally` for all `configured enpoints` by setting `NUXT_PUBLIC_IS_API_MOCKED=true`.

Comment on lines +125 to +132
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuccaBitfly plz correct me if I am wrong here

## Descision Record

We documented our decisions in the [decisions](decisions.md) file.
Expand Down
1 change: 1 addition & 0 deletions frontend/composables/useCustomFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export function useCustomFetch() {
options.query = {
...options.query,
...query,
is_mocked: true,
}
options.credentials = 'include'
const method = options.method || map.method || 'GET'
Expand Down
1 change: 1 addition & 0 deletions frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default defineNuxtConfig({
deploymentType: process.env.PUBLIC_DEPLOYMENT_TYPE,
domain: process.env.PUBLIC_DOMAIN,
gitVersion,
isApiMocked: '',
legacyApiClient: process.env.PUBLIC_LEGACY_API_CLIENT,
logFile: '',
logIp: '',
Expand Down
2 changes: 1 addition & 1 deletion frontend/types/datatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export type SortOrder = -1 | 0 | 1 | null | undefined

export type TableQueryParams = {
cursor?: Cursor,
isMocked?: boolean,
is_mocked?: boolean,
limit?: number,
order?: ColumnOrder,
search?: string,
Expand Down
Loading