Write handlers
This is the official documentation of the @forestadmin/agent
Node.js agent.
You may want to be able to create or edit new records from the Forest Admin GUI.
Implementation
The implementation is very straightforward: you need to implement 3 handlers: createRecord
, updateRecord
and deleteRecord
.
All handlers are optional and can be omitted if you don't want to support a specific operation.
The createRecord
handler can return a value. This is useful if the target API generates an id
for the record.
Example
In this example, we will use the JSON Placeholder ↗ API to create, update and delete records.
Last updated