You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the purgeAdmin function should also include ctx.request.body on the params that's sent to cacheStore.clearByUid allowing for url paths that include more than just the id.
Reasoning for that is that today when you hit save on the admin, the params object only include the id of the object, only purging urls that include :id as a result and not working for :slug or other cases, so this example here: https://strapi-community.github.io/strapi-plugin-rest-cache/guide/strategy/cache-custom-routes.html#frontmatter-title does't seem to be purged when hitting save, only when you explicitly click Purge REST Cache on the entity (that already adds the whole object to the cacheStore.clearByUid call).
Here's the change I did that seem to fix the issue:
Hey team!
I believe the
purgeAdmin
function should also includectx.request.body
on theparams
that's sent tocacheStore.clearByUid
allowing for url paths that include more than just theid
.Reasoning for that is that today when you hit save on the admin, the
params
object only include theid
of the object, only purging urls that include:id
as a result and not working for:slug
or other cases, so this example here: https://strapi-community.github.io/strapi-plugin-rest-cache/guide/strategy/cache-custom-routes.html#frontmatter-title does't seem to be purged when hitting save, only when you explicitly clickPurge REST Cache
on the entity (that already adds the whole object to thecacheStore.clearByUid
call).Here's the change I did that seem to fix the issue:
This issue body was partially generated by patch-package.
Let me know if that looks good to you guys and I can also send a PR with this.
The text was updated successfully, but these errors were encountered: