Report a bug (probably in the SDK @ts-ghost/admin-api
)
SDK Version:
"@ts-ghost/admin-api": "^4.0.1"
Error message:
{
"type": "NotFoundError",
"message": "Resource not found",
"context": null
}
Steps to reproduce:
- Create two posts
- Then delete them one after the other, using the same
TSGhostAdminAPI
instance and its API.posts.delete()
- Result: the first request will succeed, while the second one will fail with the error above
Notice:
- The error message is misleading. If the post is indeed not there, the error message would be:
{
"type": "NotFoundError",
"message": "Resource not found error, cannot delete post.",
"context": "Post not found."
}
- If the TSGhostAdminAPI instance is created every time before invoking the
.posts.delete()
API, then the deletions would succeed. So there is a bug somewhere in the client-side SDK, per my understanding.
Thanks!