@websolutespa/payload-plugin-bowl 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @websolutespa/payload-plugin-bowl
2
2
 
3
+ ## 1.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixing: PageService decorators
8
+
3
9
  ## 1.3.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -219,7 +219,7 @@ type IPagination = {
219
219
  };
220
220
  declare function getPagination<T = IEntity>(items: T[], page?: number, limit?: number): Promise<PaginatedDocs<T>>;
221
221
 
222
- declare function getRoutes(req: PayloadRequest<any>): Promise<IRoute[]>;
222
+ declare function getRoutes(req: PayloadRequest): Promise<IRoute[]>;
223
223
  declare function getRoute(req: PayloadRequest<any>, id: string): Promise<IRoute | null>;
224
224
  declare function getRouteByItemAndLocale(req: PayloadRequest<any>, item: ICategorized, localeId: string, slug: string): Promise<IRoute[]>;
225
225
  declare function getRouteByCategoryAndLocale(req: PayloadRequest<any>, item: ICategory, localeId: string, slug: string): Promise<IRoute[]>;
package/dist/index.js CHANGED
@@ -3769,20 +3769,34 @@ __name(decorateSchemas_, "decorateSchemas_");
3769
3769
 
3770
3770
  // src/core/api/page.service.ts
3771
3771
  async function decorateOne_(req, item, slug, market, locale) {
3772
- const routes = await getRoutes(req);
3773
- const categories = await getCollectionItems(req, options.slug.category);
3774
- const withSchema = await decorateSchema_(req, item, slug, market, locale, categories, routes);
3775
- const withHref = await decorateHref_(req, withSchema, slug, market, locale, categories, routes);
3776
- const withNav = await decorateNav_(req, withHref, slug, market, locale, categories, routes);
3772
+ const { where, ...query } = req.query;
3773
+ const subRequest = {
3774
+ ...req,
3775
+ query: {
3776
+ ...query
3777
+ }
3778
+ };
3779
+ const routes = await getRoutes(subRequest);
3780
+ const categories = await getCollectionItems(subRequest, options.slug.category);
3781
+ const withSchema = await decorateSchema_(subRequest, item, slug, market, locale, categories, routes);
3782
+ const withHref = await decorateHref_(subRequest, withSchema, slug, market, locale, categories, routes);
3783
+ const withNav = await decorateNav_(subRequest, withHref, slug, market, locale, categories, routes);
3777
3784
  return withNav;
3778
3785
  }
3779
3786
  __name(decorateOne_, "decorateOne_");
3780
3787
  async function decorateMany_(req, items, slug, market, locale) {
3781
- const routes = await getRoutes(req);
3782
- const categories = await getCollectionItems(req, options.slug.category);
3783
- const withSchema = await decorateSchemas_(req, items, slug, market, locale, categories, routes);
3784
- const withHref = await decorateHrefs_(req, withSchema, slug, market, locale, categories, routes);
3785
- const withNav = await decorateNavs_(req, withHref, slug, market, locale, categories, routes);
3788
+ const { where, ...query } = req.query;
3789
+ const subRequest = {
3790
+ ...req,
3791
+ query: {
3792
+ ...query
3793
+ }
3794
+ };
3795
+ const routes = await getRoutes(subRequest);
3796
+ const categories = await getCollectionItems(subRequest, options.slug.category);
3797
+ const withSchema = await decorateSchemas_(subRequest, items, slug, market, locale, categories, routes);
3798
+ const withHref = await decorateHrefs_(subRequest, withSchema, slug, market, locale, categories, routes);
3799
+ const withNav = await decorateNavs_(subRequest, withHref, slug, market, locale, categories, routes);
3786
3800
  return withNav;
3787
3801
  }
3788
3802
  __name(decorateMany_, "decorateMany_");
@@ -4570,8 +4584,7 @@ var withPage = /* @__PURE__ */ __name((config) => {
4570
4584
  // src/core/api/route.service.ts
4571
4585
  var CACHE_3 = new InMemoryCache();
4572
4586
  async function getRoutes(req) {
4573
- const query = req.query;
4574
- const { market, locale, draft } = query;
4587
+ const { market, locale, draft } = req.query;
4575
4588
  const subRequest = {
4576
4589
  ...req,
4577
4590
  query: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/payload-plugin-bowl",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Bowl PayloadCms plugin of the BOM Repository",
5
5
  "keywords": [
6
6
  "payload",