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 SearchGiftCardTagsQueryResult = Apollo.QueryResult<Types.SearchGiftCardTagsQuery, Types.SearchGiftCardTagsQueryVariables>;
|
||||
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(
|
||||
first: $first
|
||||
after: $after
|
||||
filter: {search: $query}
|
||||
filter: {search: $query, isPublished: $isPublished, stockAvailability: $stockAvailability}
|
||||
channel: $channel
|
||||
) {
|
||||
edges {
|
||||
|
@ -13059,6 +13059,8 @@ export const SearchOrderVariantDocument = gql`
|
|||
* query: // value for 'query'
|
||||
* after: // value for 'after'
|
||||
* address: // value for 'address'
|
||||
* isPublished: // value for 'isPublished'
|
||||
* stockAvailability: // value for 'stockAvailability'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
|
|
|
@ -6908,6 +6908,8 @@ export type SearchOrderVariantQueryVariables = Exact<{
|
|||
query: Scalars['String'];
|
||||
after?: InputMaybe<Scalars['String']>;
|
||||
address?: InputMaybe<AddressInput>;
|
||||
isPublished?: InputMaybe<Scalars['Boolean']>;
|
||||
stockAvailability?: InputMaybe<StockAvailability>;
|
||||
}>;
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import {
|
|||
OrderDetailsQuery,
|
||||
OrderDraftUpdateMutation,
|
||||
OrderDraftUpdateMutationVariables,
|
||||
StockAvailability,
|
||||
useCustomerAddressesQuery
|
||||
} from "@saleor/graphql";
|
||||
import useNavigator from "@saleor/hooks/useNavigator";
|
||||
|
@ -95,7 +96,9 @@ export const OrderDraftDetails: React.FC<OrderDraftDetailsProps> = ({
|
|||
variables: {
|
||||
...DEFAULT_INITIAL_SEARCH_DATA,
|
||||
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,
|
||||
result: variantSearchOpts
|
||||
} = useOrderVariantSearch({
|
||||
variables: { ...DEFAULT_INITIAL_SEARCH_DATA, channel: order.channel.slug }
|
||||
variables: {
|
||||
...DEFAULT_INITIAL_SEARCH_DATA,
|
||||
channel: order.channel.slug
|
||||
}
|
||||
});
|
||||
const warehouses = useWarehouseListQuery({
|
||||
displayLoader: true,
|
||||
|
|
|
@ -13,11 +13,17 @@ export const searchOrderVariant = gql`
|
|||
$query: String!
|
||||
$after: String
|
||||
$address: AddressInput
|
||||
$isPublished: Boolean
|
||||
$stockAvailability: StockAvailability
|
||||
) {
|
||||
search: products(
|
||||
first: $first
|
||||
after: $after
|
||||
filter: { search: $query }
|
||||
filter: {
|
||||
search: $query
|
||||
isPublished: $isPublished
|
||||
stockAvailability: $stockAvailability
|
||||
}
|
||||
channel: $channel
|
||||
) {
|
||||
edges {
|
||||
|
|
Loading…
Reference in a new issue