Fix sale create view
This commit is contained in:
parent
5131c50d45
commit
3c103160f4
1 changed files with 8 additions and 5 deletions
|
@ -6,7 +6,7 @@ import useNavigator from "@saleor/hooks/useNavigator";
|
|||
import useNotifier from "@saleor/hooks/useNotifier";
|
||||
import useShop from "@saleor/hooks/useShop";
|
||||
import { sectionNames } from "@saleor/intl";
|
||||
import { decimal, getMutationState, maybe } from "../../misc";
|
||||
import { decimal, getMutationState, joinDateTime, maybe } from "../../misc";
|
||||
import { DiscountValueTypeEnum, SaleType } from "../../types/globalTypes";
|
||||
import SaleCreatePage from "../components/SaleCreatePage";
|
||||
import { TypedSaleCreate } from "../mutations";
|
||||
|
@ -57,11 +57,14 @@ export const SaleDetails: React.StatelessComponent = () => {
|
|||
saleCreate({
|
||||
variables: {
|
||||
input: {
|
||||
endDate:
|
||||
formData.endDate === "" ? null : formData.endDate,
|
||||
endDate: formData.hasEndDate
|
||||
? joinDateTime(formData.endDate, formData.endTime)
|
||||
: null,
|
||||
name: formData.name,
|
||||
startDate:
|
||||
formData.startDate === "" ? null : formData.startDate,
|
||||
startDate: joinDateTime(
|
||||
formData.startDate,
|
||||
formData.startTime
|
||||
),
|
||||
type: discountValueTypeEnum(formData.type),
|
||||
value: decimal(formData.value)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue