Fetch only published producs in draft order (#1921)
This commit is contained in:
parent
560ed2cd6e
commit
7b45ef2758
5 changed files with 21 additions and 5 deletions
|
@ -12986,11 +12986,11 @@ export type SearchGiftCardTagsQueryHookResult = ReturnType<typeof useSearchGiftC
|
||||||
export type SearchGiftCardTagsLazyQueryHookResult = ReturnType<typeof useSearchGiftCardTagsLazyQuery>;
|
export type SearchGiftCardTagsLazyQueryHookResult = ReturnType<typeof useSearchGiftCardTagsLazyQuery>;
|
||||||
export type SearchGiftCardTagsQueryResult = Apollo.QueryResult<Types.SearchGiftCardTagsQuery, Types.SearchGiftCardTagsQueryVariables>;
|
export type SearchGiftCardTagsQueryResult = Apollo.QueryResult<Types.SearchGiftCardTagsQuery, Types.SearchGiftCardTagsQueryVariables>;
|
||||||
export const SearchOrderVariantDocument = gql`
|
export const SearchOrderVariantDocument = gql`
|
||||||
query SearchOrderVariant($channel: String!, $first: Int!, $query: String!, $after: String, $address: AddressInput) {
|
query SearchOrderVariant($channel: String!, $first: Int!, $query: String!, $after: String, $address: AddressInput, $isPublished: Boolean, $stockAvailability: StockAvailability) {
|
||||||
search: products(
|
search: products(
|
||||||
first: $first
|
first: $first
|
||||||
after: $after
|
after: $after
|
||||||
filter: {search: $query}
|
filter: {search: $query, isPublished: $isPublished, stockAvailability: $stockAvailability}
|
||||||
channel: $channel
|
channel: $channel
|
||||||
) {
|
) {
|
||||||
edges {
|
edges {
|
||||||
|
@ -13059,6 +13059,8 @@ export const SearchOrderVariantDocument = gql`
|
||||||
* query: // value for 'query'
|
* query: // value for 'query'
|
||||||
* after: // value for 'after'
|
* after: // value for 'after'
|
||||||
* address: // value for 'address'
|
* address: // value for 'address'
|
||||||
|
* isPublished: // value for 'isPublished'
|
||||||
|
* stockAvailability: // value for 'stockAvailability'
|
||||||
* },
|
* },
|
||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6908,6 +6908,8 @@ export type SearchOrderVariantQueryVariables = Exact<{
|
||||||
query: Scalars['String'];
|
query: Scalars['String'];
|
||||||
after?: InputMaybe<Scalars['String']>;
|
after?: InputMaybe<Scalars['String']>;
|
||||||
address?: InputMaybe<AddressInput>;
|
address?: InputMaybe<AddressInput>;
|
||||||
|
isPublished?: InputMaybe<Scalars['Boolean']>;
|
||||||
|
stockAvailability?: InputMaybe<StockAvailability>;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {
|
||||||
OrderDetailsQuery,
|
OrderDetailsQuery,
|
||||||
OrderDraftUpdateMutation,
|
OrderDraftUpdateMutation,
|
||||||
OrderDraftUpdateMutationVariables,
|
OrderDraftUpdateMutationVariables,
|
||||||
|
StockAvailability,
|
||||||
useCustomerAddressesQuery
|
useCustomerAddressesQuery
|
||||||
} from "@saleor/graphql";
|
} from "@saleor/graphql";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
|
@ -95,7 +96,9 @@ export const OrderDraftDetails: React.FC<OrderDraftDetailsProps> = ({
|
||||||
variables: {
|
variables: {
|
||||||
...DEFAULT_INITIAL_SEARCH_DATA,
|
...DEFAULT_INITIAL_SEARCH_DATA,
|
||||||
channel: order.channel.slug,
|
channel: order.channel.slug,
|
||||||
address: getVariantSearchAddress(order)
|
address: getVariantSearchAddress(order),
|
||||||
|
isPublished: true,
|
||||||
|
stockAvailability: StockAvailability.IN_STOCK
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,10 @@ export const OrderUnconfirmedDetails: React.FC<OrderUnconfirmedDetailsProps> = (
|
||||||
search: variantSearch,
|
search: variantSearch,
|
||||||
result: variantSearchOpts
|
result: variantSearchOpts
|
||||||
} = useOrderVariantSearch({
|
} = useOrderVariantSearch({
|
||||||
variables: { ...DEFAULT_INITIAL_SEARCH_DATA, channel: order.channel.slug }
|
variables: {
|
||||||
|
...DEFAULT_INITIAL_SEARCH_DATA,
|
||||||
|
channel: order.channel.slug
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const warehouses = useWarehouseListQuery({
|
const warehouses = useWarehouseListQuery({
|
||||||
displayLoader: true,
|
displayLoader: true,
|
||||||
|
|
|
@ -13,11 +13,17 @@ export const searchOrderVariant = gql`
|
||||||
$query: String!
|
$query: String!
|
||||||
$after: String
|
$after: String
|
||||||
$address: AddressInput
|
$address: AddressInput
|
||||||
|
$isPublished: Boolean
|
||||||
|
$stockAvailability: StockAvailability
|
||||||
) {
|
) {
|
||||||
search: products(
|
search: products(
|
||||||
first: $first
|
first: $first
|
||||||
after: $after
|
after: $after
|
||||||
filter: { search: $query }
|
filter: {
|
||||||
|
search: $query
|
||||||
|
isPublished: $isPublished
|
||||||
|
stockAvailability: $stockAvailability
|
||||||
|
}
|
||||||
channel: $channel
|
channel: $channel
|
||||||
) {
|
) {
|
||||||
edges {
|
edges {
|
||||||
|
|
Loading…
Reference in a new issue