I’m using a custom handler to fetch a list of WordPress options from my server
const response = await libraries.source.api.get({
endpoint: `/acf/v3/options/options`,
});
const [options] = await libraries.source.populate({
response,
state,
force,
});
Object.assign(state.source.data[link], options);
source.populate
is throwing an error because ID is undefined. Since this is just a collection of key/value site options there is no ID field. I would like to use populate since it’s the official API and I think will cache the values.
I can get it to work by just getting the key from source and setting the data, but the data is reloaded every page change vs being cached after the first page load.
Any ideas on how to use source.populate without an ID field?