fix(dashboard,types,js-sdk): Cleanup settings/store (#8336)

**What**
- Cleans up Store domain of all TS errors
- Adds layout component to Store domain
- Adds currencies types and js-sdk methods
- Fixes a bug that caused Table rows to render incorrectly when takings up more then the viewport height.
This commit is contained in:
Kasper Fabricius Kristensen
2024-07-29 19:44:40 +00:00
committed by GitHub
parent 24c105f288
commit 1d773c536f
19 changed files with 229 additions and 103 deletions
@@ -0,0 +1,37 @@
import { HttpTypes } from "@medusajs/types"
import { Client } from "../client"
import { ClientHeaders } from "../types"
export class Currency {
private client: Client
constructor(client: Client) {
this.client = client
}
async list(
query?: HttpTypes.AdminCurrencyListParams,
headers?: ClientHeaders
) {
return this.client.fetch<HttpTypes.AdminCurrencyListResponse>(
`/admin/currencies`,
{
headers,
query,
}
)
}
async retrieve(
id: string,
query?: HttpTypes.AdminCurrencyParams,
headers?: ClientHeaders
) {
return this.client.fetch<HttpTypes.AdminCurrencyResponse>(
`/admin/currencies/${id}`,
{
headers,
query,
}
)
}
}
+4 -1
View File
@@ -1,4 +1,5 @@
import { Client } from "../client"
import { Currency } from "./currency"
import { Customer } from "./customer"
import { Fulfillment } from "./fulfillment"
import { FulfillmentProvider } from "./fulfillment-provider"
@@ -16,6 +17,7 @@ import { ProductTag } from "./product-tag"
import { ProductType } from "./product-type"
import { Region } from "./region"
import { Return } from "./return"
import { ReturnReason } from "./return-reason"
import { SalesChannel } from "./sales-channel"
import { ShippingOption } from "./shipping-option"
import { ShippingProfile } from "./shipping-profile"
@@ -25,7 +27,6 @@ import { TaxRate } from "./tax-rate"
import { TaxRegion } from "./tax-region"
import { Upload } from "./upload"
import { User } from "./user"
import { ReturnReason } from "./return-reason"
export class Admin {
public invite: Invite
@@ -55,6 +56,7 @@ export class Admin {
public store: Store
public productTag: ProductTag
public user: User
public currency: Currency
constructor(client: Client) {
this.invite = new Invite(client)
@@ -84,5 +86,6 @@ export class Admin {
this.store = new Store(client)
this.productTag = new ProductTag(client)
this.user = new User(client)
this.currency = new Currency(client)
}
}