Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Sebastian Rindom
2021-10-26 22:12:46 +02:00
10 changed files with 61 additions and 12 deletions

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.35](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.34...medusa-plugin-brightpearl@1.1.35) (2021-10-26)
### Bug Fixes
- add missing discount rule to bp orders ([#680](https://github.com/medusajs/medusa/issues/680)) ([d8422fc](https://github.com/medusajs/medusa/commit/d8422fc759f8a55e6290d4f54f3ea38df3118c8b))
## [1.1.34](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.33...medusa-plugin-brightpearl@1.1.34) (2021-10-18)
**Note:** Version bump only for package medusa-plugin-brightpearl

View File

@@ -1,6 +1,6 @@
{
"name": "medusa-plugin-brightpearl",
"version": "1.1.34",
"version": "1.1.35",
"description": "Brightpearl plugin for Medusa Commerce",
"main": "index.js",
"repository": {

View File

@@ -77,6 +77,7 @@ class OrderSubscriber {
"order.region",
"order.swaps",
"order.discounts",
"order.discounts.rule",
"return_order",
"return_order.items",
"return_order.shipping_method",
@@ -109,6 +110,7 @@ class OrderSubscriber {
"order.region",
"order.claims",
"order.discounts",
"order.discounts.rule",
"claim_items",
"return_order",
"return_order.items",

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.32](https://github.com/medusajs/medusa/compare/medusa-plugin-contentful@1.1.31...medusa-plugin-contentful@1.1.32) (2021-10-25)
### Bug Fixes
- make contentful data sync ([548f6c7](https://github.com/medusajs/medusa/commit/548f6c7138d9a08b6c2113ebdda27f13dee848ac))
## [1.1.31](https://github.com/medusajs/medusa/compare/medusa-plugin-contentful@1.1.30...medusa-plugin-contentful@1.1.31) (2021-10-18)
**Note:** Version bump only for package medusa-plugin-contentful

View File

@@ -1,6 +1,6 @@
{
"name": "medusa-plugin-contentful",
"version": "1.1.31",
"version": "1.1.32",
"description": "Contentful plugin for Medusa Commerce",
"main": "index.js",
"repository": {

View File

@@ -742,21 +742,35 @@ class ContentfulService extends BaseService {
const environment = await this.getContentfulEnvironment_()
const productEntry = await environment.getEntry(productId)
const product = await this.productService_.retrieve(productId)
const product = await this.productService_.retrieve(productId, {
select: [
"id",
"handle",
"title",
"subtitle",
"description",
"thumbnail",
],
})
const update = {}
const title =
productEntry.fields[this.getCustomField("title", "product")]["en-US"]
productEntry.fields[this.getCustomField("title", "product")]?.["en-US"]
const subtitle =
productEntry.fields[this.getCustomField("subtitle", "product")]["en-US"]
const description =
productEntry.fields[this.getCustomField("description", "product")][
productEntry.fields[this.getCustomField("subtitle", "product")]?.[
"en-US"
]
const description =
productEntry.fields[this.getCustomField("description", "product")]?.[
"en-US"
]
const handle =
productEntry.fields[this.getCustomField("handle", "product")]?.["en-US"]
if (product.title !== title) {
update.title = title
}
@@ -769,6 +783,10 @@ class ContentfulService extends BaseService {
update.description = description
}
if (product.handle !== handle) {
update.handle = handle
}
// Get the thumbnail, if present
if (productEntry.fields.thumbnail) {
const thumb = await environment.getAsset(
@@ -776,7 +794,7 @@ class ContentfulService extends BaseService {
)
if (thumb.fields.file["en-US"].url) {
if (!product.thumbnail.includes(thumb.fields.file["en-US"].url)) {
if (!product.thumbnail?.includes(thumb.fields.file["en-US"].url)) {
update.thumbnail = thumb.fields.file["en-US"].url
}
}
@@ -834,7 +852,6 @@ class ContentfulService extends BaseService {
output.push(transformed)
}
console.log(output)
if (!isArray) {
return output[0]
}

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.49](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.48...@medusajs/medusa@1.1.49) (2021-10-26)
### Bug Fixes
- allow empty string to search product route ([52c47ab](https://github.com/medusajs/medusa/commit/52c47abd407704d02caf7a6bfb3c4777717828b7))
## [1.1.48](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.47...@medusajs/medusa@1.1.48) (2021-10-25)
### Bug Fixes
- make contentful data sync ([548f6c7](https://github.com/medusajs/medusa/commit/548f6c7138d9a08b6c2113ebdda27f13dee848ac))
## [1.1.47](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.46...@medusajs/medusa@1.1.47) (2021-10-23)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@medusajs/medusa",
"version": "1.1.47",
"version": "1.1.49",
"description": "E-commerce for JAMstack",
"main": "dist/index.js",
"bin": {

View File

@@ -4,7 +4,9 @@ import ProductService from "../../../../services/product"
export default async (req, res) => {
const schema = Validator.object()
.keys({
q: Validator.string().required(),
q: Validator.string()
.required()
.allow(""),
offset: Validator.number().optional(),
limit: Validator.number().optional(),
filter: Validator.any(),

View File

@@ -55,6 +55,10 @@ export class ProductRepository extends Repository<Product> {
return []
}
if (relations.length === 0) {
return this.findByIds(entitiesIds, idsOrOptionsWithoutRelations)
}
const groupedRelations: { [toplevel: string]: string[] } = {}
for (const rel of relations) {
const [topLevel] = rel.split(".")