hi there, i call external api from the 'beforeChange' hook, and i would like to update admin panel to display current status of this operation, something like "syncing with the API", "syncing complete", somewhere in header or sidebar. Could anyone give any tips on how to go about this?
@kulczy Morning! You could start by creating a custom Admin Component. This will allow you to add it somewhere that makes sense. The component would make a request to the external data and report status (loading indicator?). This is how I see it working, but others might have better solutions.
@kulczy for a slightly different approach you can checkout this
syncDocs
button:
https://github.com/payloadcms/website-cms/blob/main/src/payload.config.ts#L156It adds a component to
afterNavLinks
that hits a custom endpoint to fetch data from GitHub.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.