diff --git a/packages/admin-ui/src/lib/catalog/src/components/variant-price-detail/variant-price-detail.component.ts b/packages/admin-ui/src/lib/catalog/src/components/variant-price-detail/variant-price-detail.component.ts index c036b60e04..acb1b335a7 100644 --- a/packages/admin-ui/src/lib/catalog/src/components/variant-price-detail/variant-price-detail.component.ts +++ b/packages/admin-ui/src/lib/catalog/src/components/variant-price-detail/variant-price-detail.component.ts @@ -25,7 +25,7 @@ export class VariantPriceDetailComponent implements OnInit, OnChanges { ngOnInit() { const taxRates$ = this.dataService.settings - .getTaxRates(999, 0, 'cache-first') + .getTaxRatesSimple(999, 0, 'cache-first') .mapStream(data => data.taxRates.items); const activeChannel$ = this.dataService.settings .getActiveChannel('cache-first') diff --git a/packages/admin-ui/src/lib/core/src/common/generated-types.ts b/packages/admin-ui/src/lib/core/src/common/generated-types.ts index 7ebc68429a..9c7802dabc 100644 --- a/packages/admin-ui/src/lib/core/src/common/generated-types.ts +++ b/packages/admin-ui/src/lib/core/src/common/generated-types.ts @@ -7463,6 +7463,27 @@ export type GetTaxRateListQuery = { taxRates: ( )> } ) }; +export type GetTaxRateListSimpleQueryVariables = Exact<{ + options?: Maybe; +}>; + + +export type GetTaxRateListSimpleQuery = { taxRates: ( + { __typename?: 'TaxRateList' } + & Pick + & { items: Array<( + { __typename?: 'TaxRate' } + & Pick + & { category: ( + { __typename?: 'TaxCategory' } + & Pick + ), zone: ( + { __typename?: 'Zone' } + & Pick + ) } + )> } + ) }; + export type GetTaxRateQueryVariables = Exact<{ id: Scalars['ID']; }>; @@ -9851,6 +9872,15 @@ export namespace GetTaxRateList { export type Items = NonNullable<(NonNullable<(NonNullable)['items']>)[number]>; } +export namespace GetTaxRateListSimple { + export type Variables = GetTaxRateListSimpleQueryVariables; + export type Query = GetTaxRateListSimpleQuery; + export type TaxRates = (NonNullable); + export type Items = NonNullable<(NonNullable<(NonNullable)['items']>)[number]>; + export type Category = (NonNullable)['items']>)[number]>['category']>); + export type Zone = (NonNullable)['items']>)[number]>['zone']>); +} + export namespace GetTaxRate { export type Variables = GetTaxRateQueryVariables; export type Query = GetTaxRateQuery; diff --git a/packages/admin-ui/src/lib/core/src/data/definitions/settings-definitions.ts b/packages/admin-ui/src/lib/core/src/data/definitions/settings-definitions.ts index a2abfdf8e8..cf8caf5e1e 100644 --- a/packages/admin-ui/src/lib/core/src/data/definitions/settings-definitions.ts +++ b/packages/admin-ui/src/lib/core/src/data/definitions/settings-definitions.ts @@ -259,6 +259,30 @@ export const GET_TAX_RATE_LIST = gql` ${TAX_RATE_FRAGMENT} `; +export const GET_TAX_RATE_LIST_SIMPLE = gql` + query GetTaxRateListSimple($options: TaxRateListOptions) { + taxRates(options: $options) { + items { + id + createdAt + updatedAt + name + enabled + value + category { + id + name + } + zone { + id + name + } + } + totalItems + } + } +`; + export const GET_TAX_RATE = gql` query GetTaxRate($id: ID!) { taxRate(id: $id) { diff --git a/packages/admin-ui/src/lib/core/src/data/providers/settings-data.service.ts b/packages/admin-ui/src/lib/core/src/data/providers/settings-data.service.ts index 8f386a6bca..6cc2db163e 100644 --- a/packages/admin-ui/src/lib/core/src/data/providers/settings-data.service.ts +++ b/packages/admin-ui/src/lib/core/src/data/providers/settings-data.service.ts @@ -40,6 +40,7 @@ import { GetTaxCategory, GetTaxRate, GetTaxRateList, + GetTaxRateListSimple, GetZone, GetZones, JobListOptions, @@ -93,6 +94,7 @@ import { GET_TAX_CATEGORY, GET_TAX_RATE, GET_TAX_RATE_LIST, + GET_TAX_RATE_LIST_SIMPLE, GET_ZONES, REMOVE_MEMBERS_FROM_ZONE, UPDATE_CHANNEL, @@ -243,6 +245,19 @@ export class SettingsDataService { ); } + getTaxRatesSimple(take: number = 10, skip: number = 0, fetchPolicy?: FetchPolicy) { + return this.baseDataService.query( + GET_TAX_RATE_LIST_SIMPLE, + { + options: { + take, + skip, + }, + }, + fetchPolicy, + ); + } + getTaxRate(id: string) { return this.baseDataService.query(GET_TAX_RATE, { id,