Skip to content

Commit

Permalink
Merge branch 'develop' into feat/customer-store-addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
srindom authored Feb 1, 2024
2 parents 73b7f1c + fab1799 commit 68c88d5
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 113 deletions.
6 changes: 1 addition & 5 deletions packages/link-modules/src/definitions/cart-sales-channel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Modules } from "@medusajs/modules-sdk"
import { ModuleJoinerConfig } from "@medusajs/types"
import { LINKS } from "../links"
import { Modules } from "@medusajs/modules-sdk"

export const CartSalesChannel: ModuleJoinerConfig = {
serviceName: LINKS.CartSalesChannel,
Expand All @@ -21,14 +21,12 @@ export const CartSalesChannel: ModuleJoinerConfig = {
relationships: [
{
serviceName: Modules.CART,
isInternalService: true,
primaryKey: "id",
foreignKey: "cart_id",
alias: "cart",
},
{
serviceName: Modules.SALES_CHANNEL,
isInternalService: true,
primaryKey: "id",
foreignKey: "sales_channel_id",
alias: "sales_channel",
Expand All @@ -42,7 +40,6 @@ export const CartSalesChannel: ModuleJoinerConfig = {
},
relationship: {
serviceName: LINKS.CartSalesChannel,
isInternalService: true,
primaryKey: "cart_id",
foreignKey: "id",
alias: "sales_channel_link",
Expand All @@ -55,7 +52,6 @@ export const CartSalesChannel: ModuleJoinerConfig = {
},
relationship: {
serviceName: LINKS.CartSalesChannel,
isInternalService: true,
primaryKey: "sales_channel_id",
foreignKey: "id",
alias: "cart_link",
Expand Down
31 changes: 10 additions & 21 deletions packages/medusa/src/api-v2/store/carts/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
import { ICartModuleService } from "@medusajs/types"
import { MedusaRequest, MedusaResponse } from "../../../../types/routing"
import { defaultStoreCartRemoteQueryObject } from "../query-config"

export const GET = async (req: MedusaRequest, res: MedusaResponse) => {
const cartModuleService: ICartModuleService = req.scope.resolve(
ModuleRegistrationName.CART
)
const remoteQuery = req.scope.resolve("remoteQuery")

// TODO: Replace with remoteQuery
const cart = await cartModuleService.retrieve(req.params.id, {
select: req.retrieveConfig.select,
relations: req.retrieveConfig.relations,
})
const variables = { id: req.params.id }

// const remoteQuery = req.scope.resolve("remoteQuery")
const query = {
cart: {
__args: variables,
...defaultStoreCartRemoteQueryObject,
},
}

// const variables = { id: req.params.id }

// const query = {
// cart: {
// __args: variables,
// ...defaultStoreCartRemoteQueryObject,
// },
// }

// const [cart] = await remoteQuery(query)
const [cart] = await remoteQuery(query)

res.json({ cart })
}
2 changes: 1 addition & 1 deletion packages/medusa/src/api-v2/store/carts/query-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const retrieveTransformQueryConfig = {

export const defaultStoreCartRemoteQueryObject = {
fields: defaultStoreCartFields,
line_items: {
items: {
fields: [
"id",
"created_at",
Expand Down
37 changes: 0 additions & 37 deletions packages/medusa/src/joiner-configs/cart-service.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/medusa/src/joiner-configs/customer-service.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/medusa/src/joiner-configs/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export * as cart from "./cart-service"
export * as customer from "./customer-service"
export * as publishableApiKey from "./publishable-api-key-service"
export * as region from "./region-service"
export * as shippingProfile from "./shipping-profile-service"

15 changes: 0 additions & 15 deletions packages/medusa/src/joiner-configs/order-service.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/medusa/src/joiner-configs/region-service.ts

This file was deleted.

2 changes: 1 addition & 1 deletion www/apps/docs/announcement.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":"https://github.com/medusajs/medusa/releases/tag/v1.20.1","content":"v1.20.1 is out","isCloseable":true}
{}

0 comments on commit 68c88d5

Please sign in to comment.