@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 +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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
|
|
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
|
|
3773
|
-
const
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
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
|
|
3782
|
-
const
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
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
|
|
4574
|
-
const { market, locale, draft } = query;
|
|
4587
|
+
const { market, locale, draft } = req.query;
|
|
4575
4588
|
const subRequest = {
|
|
4576
4589
|
...req,
|
|
4577
4590
|
query: {
|