Provide getSchema function in hook/endpoint registration function

Fixes #4621
This commit is contained in:
rijkvanzanten
2021-03-22 20:13:49 -04:00
parent 71c8c4cc2c
commit 3eaa375952
4 changed files with 7 additions and 2 deletions

View File

@@ -38,6 +38,7 @@ that is scoped to `/custom/<extension-name>`, while `context` holds the followin
- `services` — All API internal services.
- `exceptions` API exception objects that can be used to throw "proper" errors.
- `database` — Knex instance that is connected to the current database.
- `getSchema` — Async function that reads the full available schema for use in services
- `env` Parsed environment variables.
## 3. Restart the API

View File

@@ -126,6 +126,7 @@ The `registerHook` function receives a context parameter with the following prop
- `services` — All API internal services
- `exceptions` API exception objects that can be used for throwing "proper" errors
- `database` — Knex instance that is connected to the current database
- `getSchema` — Async function that reads the full available schema for use in services
- `env` Parsed environment variables
### Event Handler Function