chore: cleanup inspection (#6358)
This commit is contained in:
1 parent
94062d28be
commit
b91a1ca5b8
19 files changed
+66
-72
No files matched your search
@@ -7,7 +7,7 @@ import {
|
||||
} from "@medusajs/modules-sdk"
|
||||
import { ICartModuleService, ModulesSdkTypes } from "@medusajs/types"
|
||||
import { moduleDefinition } from "../module-definition"
|
||||
import { InitializeModuleInjectableDependencies } from "../types"
|
||||
import { InitializeModuleInjectableDependencies } from "@types"
|
||||
|
||||
export const initialize = async (
|
||||
options?:
|
||||
|
||||
@@ -403,7 +403,8 @@ export default class CartModuleService<
|
||||
itemIdsOrSelector: string | string[] | Partial<CartTypes.CartLineItemDTO>,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
): Promise<void> {
|
||||
let toDelete: string[] = []
|
||||
let toDelete: string[]
|
||||
|
||||
if (isObject(itemIdsOrSelector)) {
|
||||
const items = await this.listLineItems(
|
||||
{ ...itemIdsOrSelector } as Partial<CartTypes.CartLineItemDTO>,
|
||||
@@ -518,7 +519,7 @@ export default class CartModuleService<
|
||||
): Promise<
|
||||
CartTypes.CartShippingMethodDTO[] | CartTypes.CartShippingMethodDTO
|
||||
> {
|
||||
let methods: ShippingMethod[] = []
|
||||
let methods: ShippingMethod[]
|
||||
if (isString(cartIdOrData)) {
|
||||
methods = await this.addShippingMethods_(
|
||||
cartIdOrData,
|
||||
@@ -588,7 +589,7 @@ export default class CartModuleService<
|
||||
| Partial<CartTypes.CartShippingMethodDTO>,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
): Promise<void> {
|
||||
let toDelete: string[] = []
|
||||
let toDelete: string[]
|
||||
if (isObject(methodIdsOrSelector)) {
|
||||
const methods = await this.listShippingMethods(
|
||||
{
|
||||
@@ -742,7 +743,7 @@ export default class CartModuleService<
|
||||
| Partial<CartTypes.LineItemAdjustmentDTO>,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
): Promise<void> {
|
||||
let ids: string[] = []
|
||||
let ids: string[]
|
||||
if (isObject(adjustmentIdsOrSelector)) {
|
||||
const adjustments = await this.listLineItemAdjustments(
|
||||
{
|
||||
@@ -911,7 +912,7 @@ export default class CartModuleService<
|
||||
| Partial<CartTypes.ShippingMethodAdjustmentDTO>,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
): Promise<void> {
|
||||
let ids: string[] = []
|
||||
let ids: string[]
|
||||
if (isObject(adjustmentIdsOrSelector)) {
|
||||
const adjustments = await this.listShippingMethodAdjustments(
|
||||
{
|
||||
@@ -956,7 +957,7 @@ export default class CartModuleService<
|
||||
| CartTypes.CreateLineItemTaxLineDTO,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
): Promise<CartTypes.LineItemTaxLineDTO[] | CartTypes.LineItemTaxLineDTO> {
|
||||
let addedTaxLines: LineItemTaxLine[] = []
|
||||
let addedTaxLines: LineItemTaxLine[]
|
||||
if (isString(cartIdOrData)) {
|
||||
// existence check
|
||||
await this.retrieve(cartIdOrData, { select: ["id"] }, sharedContext)
|
||||
@@ -1065,7 +1066,7 @@ export default class CartModuleService<
|
||||
| CartTypes.FilterableShippingMethodTaxLineProps,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
): Promise<void> {
|
||||
let ids: string[] = []
|
||||
let ids: string[]
|
||||
if (isObject(taxLineIdsOrSelector)) {
|
||||
const taxLines = await this.listLineItemTaxLines(
|
||||
{
|
||||
@@ -1112,7 +1113,7 @@ export default class CartModuleService<
|
||||
): Promise<
|
||||
CartTypes.ShippingMethodTaxLineDTO[] | CartTypes.ShippingMethodTaxLineDTO
|
||||
> {
|
||||
let addedTaxLines: ShippingMethodTaxLine[] = []
|
||||
let addedTaxLines: ShippingMethodTaxLine[]
|
||||
if (isString(cartIdOrData)) {
|
||||
// existence check
|
||||
await this.retrieve(cartIdOrData, { select: ["id"] }, sharedContext)
|
||||
@@ -1222,7 +1223,7 @@ export default class CartModuleService<
|
||||
| CartTypes.FilterableShippingMethodTaxLineProps,
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
): Promise<void> {
|
||||
let ids: string[] = []
|
||||
let ids: string[]
|
||||
if (isObject(taxLineIdsOrSelector)) {
|
||||
const taxLines = await this.listShippingMethodTaxLines(
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user