Closed azappa closed 8 years ago
I switch to async module to native Promises using babeljs. I write a simple function
const getPrismicApi = async () => { return Prismic.api(configuration.apiEndpoint); }
and I call it in my routes like
const api = await getPrismicApi(); const service = await api.query(`[[:d = at(document.type, "services")][:d = at(my.services.uid, "${_slug}")]]`);
Without this (old fashioned?) line
const p = prismic.withContext(req, res); p.query(...);
from my templates I cannot access anymore to Prismic methods like doc.getText(field)...
doc.getText(field)
How can set back this funcionality??
Thank you.
Nevermind, I got solution, forgot to pass req and ctx to templates :)
I switch to async module to native Promises using babeljs. I write a simple function
and I call it in my routes like
Without this (old fashioned?) line
from my templates I cannot access anymore to Prismic methods like
doc.getText(field)
...How can set back this funcionality??
Thank you.