Skip to content

Commit

Permalink
Merge branch 'main' into use-number-field
Browse files Browse the repository at this point in the history
  • Loading branch information
zephraph committed Nov 30, 2023
2 parents 41d47a9 + 87f4d8b commit cabea63
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libs/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ export const api = new Api({
host: process.env.NODE_ENV === 'test' ? 'http://testhost' : '',
})

// add the API client to window for use from the browser JS console. requests
// will use the session cookie, same as normal API calls
if (typeof window !== 'undefined') {
// @ts-expect-error
window.oxide = api.methods
}

export type ApiMethods = typeof api.methods

export const useApiQuery = getUseApiQuery(api.methods)
Expand Down

0 comments on commit cabea63

Please sign in to comment.