Skip to content

Commit

Permalink
fix: ignore unexisting routes instead of throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
stafyniaksacha committed Feb 26, 2022
1 parent 820c967 commit 7f06c9d
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,9 @@ function resolveUserStrategy(strapi, userOptions) {
}

for (const cacheConfig of cacheConfigs) {
for (const route of cacheConfig.routes) {
if (!routeExists(strapi, route)) {
throw new Error(
`Unable to resolve rest-cache options: ${route.method} ${route.path} has no matching endpoint`
);
}
}
cacheConfig.routes = cacheConfig.routes.filter((route) =>
routeExists(strapi, route)
);
}

return deepFreeze(
Expand Down

0 comments on commit 7f06c9d

Please sign in to comment.