Hi @clay1,
Sorry, this appears to be by design. If you log the API response, it explicitly says:
{
"data": [
{
"id": "c6822a",
"type": "api_error",
"attributes": {
"code": "INVALID_X_INCLUDE_DRAFTS_HEADER",
"details": {
"message": "X-Include-Drafts header can only be set to `true`"
}
}
}
]
}
Can you change the conditional to just not set that header depending on the build environment?
For example, instead of something like this:
const headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'X-Include-Drafts': isProduction ? true : false,
};
Can it be something like this?
const headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
...(isProduction && {'X-Include-Drafts': true})
};