Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

fix: clear the two lint errors on main (#1689)

Viktor Holikb6787acf38f9
diff --git a/integration-tests/http/offer/store/offer-leadtime.spec.ts b/integration-tests/http/offer/store/offer-leadtime.spec.ts
index 5bbdd07d8..502bcae00 100644
--- a/integration-tests/http/offer/store/offer-leadtime.spec.ts
+++ b/integration-tests/http/offer/store/offer-leadtime.spec.ts
@@ -1,6 +1,5 @@
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
- IRegionModuleService,
ISalesChannelModuleService,
MedusaContainer,
} from "@medusajs/framework/types"
@@ -32,7 +31,6 @@ medusaIntegrationTestRunner({
describe("Store - Offer lead time", () => {
let appContainer: MedusaContainer
let storeHeaders: any
- let region: any
let salesChannel: any
let seedCounter = 0
@@ -149,15 +147,6 @@ medusaIntegrationTestRunner({
name: "Default Store",
})
- const regionModule = appContainer.resolve<IRegionModuleService>(
- Modules.REGION
- )
- region = await regionModule.createRegions({
- name: "Test Region",
- currency_code: "usd",
- countries: ["us"],
- })
-
const apiKey = await generatePublishableKey(appContainer)
storeHeaders = generateStoreHeaders({ publishableKey: apiKey })
diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts
index 2ad008c31..f52b0b6b1 100644
--- a/packages/client/src/index.ts
+++ b/packages/client/src/index.ts
@@ -150,7 +150,11 @@ export function createClient(options: ClientOptions) {
};
if (response.status === 401) {
const message = jsonError.message ?? response.statusText;
- onUnauthorized ? onUnauthorized({ status: 401, message }) : clearAuthStores(auth);
+ if (onUnauthorized) {
+ onUnauthorized({ status: 401, message });
+ } else {
+ clearAuthStores(auth);
+ }
}
throw new ClientError(
jsonError.message ?? response.statusText,