UNPKG

@websolutespa/payload-plugin-bowl

Version:

Bowl PayloadCms plugin of the BOM Repository

18 lines (17 loc) 821 B
import { decorateRichText_ } from '../decorators/rich-text'; import { decorateSchema_ } from '../decorators/schema'; /** * Decorate record with static collection data. */ export const afterGlobalReadHook = (globalConfig)=>async ({ doc, req, context, findMany })=>{ const { query = {} } = req; const { locale, market } = query; // console.log('afterGlobalReadHook', locale, market, depth); if (typeof locale === 'string' && typeof market === 'string') { const withSchema = await decorateSchema_(doc, globalConfig.slug); const withRichText = await decorateRichText_(withSchema, globalConfig.fields, context, req.payload.config); return withRichText; } else { return doc; } }; //# sourceMappingURL=global.service.js.map