Closed luca-smartpricing closed 1 year ago
Hey there, thanks for contributing!
Currently, it's mandatory to provide the endpoint separately no matter if a specific client is also provided for the module to work (it's used to inject the toolbar correctly).
It might be possible to infer it from the client in plugins, however, so I'll switch this issue to a "feature request" / "enhancement" if that's fine with you!
In the meantime, you can provide routes to your client without being required to declare a dedicated one (should be all typed):
export default defineNuxtConfig({
prismic: {
clientConfig: {
routes: [
// Resolves Page documents to URLs like "/about" and "/blog"
{
type: "page",
path: "/:uid",
},
],
},
},
});
See the documentation for more examples: https://prismic.io/docs/nuxt-3-define-routes#define-routes
Wow, thanks for the update!
Versions
Reproduction
https://stackblitz.com/edit/github-9j4ub2?file=nuxt.config.ts
What is Expected?
Removing the
enpoint
option indefineNuxtConfig.prismic
in favor ofcreateClient()
in/app/prismic/client.ts
doesn't work. (but in my projectroutes: []
option increateClient()
it works. So i declared two repository endpoint to be able to useroutes: []
)