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
Currently, when adding the config object to the router, the key roles is not part of the type HandlerConfig
// api/page/routes/page.ts
/**
* page router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::page.page', {
config: {
find: {
roles: ['public'],
},
findOne: {
// @ts-ignore - this is specified in strapi-plugin-route-permissions
roles: ['public'],
},
}
});
Diagnostics:
1. Type '{ roles: string[]; }' is not assignable to type 'HandlerConfig'.
Object literal may only specify known properties, and 'roles' does not exist in type 'HandlerConfig'.
Solution:
A solution would be to provide type definitions that would extend on the strapi HandlerConfig type.
The text was updated successfully, but these errors were encountered:
Currently, when adding the config object to the router, the key roles is not part of the type
HandlerConfig
Diagnostics:
Solution:
A solution would be to provide type definitions that would extend on the strapi
HandlerConfig
type.The text was updated successfully, but these errors were encountered: