fix(admin-ui): disallow creating OE if there is no changes (#3604)
* wip: fix modal * refactor: revert log --------- Co-authored-by: fPolic <frane@medusajs.com>
This commit is contained in:
@@ -167,7 +167,7 @@ function OrderEditModal(props: OrderEditModalProps) {
|
|||||||
const [filterTerm, setFilterTerm] = useState<string>("")
|
const [filterTerm, setFilterTerm] = useState<string>("")
|
||||||
|
|
||||||
const showTotals = currentSubtotal !== orderEdit.subtotal
|
const showTotals = currentSubtotal !== orderEdit.subtotal
|
||||||
const showNote = !!orderEdit.changes.length
|
const hasChanges = !!orderEdit.changes.length
|
||||||
|
|
||||||
const {
|
const {
|
||||||
mutateAsync: requestConfirmation,
|
mutateAsync: requestConfirmation,
|
||||||
@@ -344,7 +344,7 @@ function OrderEditModal(props: OrderEditModalProps) {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* NOTE */}
|
{/* NOTE */}
|
||||||
{showNote && (
|
{hasChanges && (
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span className="text-gray-500">Note</span>
|
<span className="text-gray-500">Note</span>
|
||||||
<InputField
|
<InputField
|
||||||
@@ -370,7 +370,7 @@ function OrderEditModal(props: OrderEditModalProps) {
|
|||||||
variant="primary"
|
variant="primary"
|
||||||
size="small"
|
size="small"
|
||||||
type="button"
|
type="button"
|
||||||
disabled={isUpdating || isRequestingConfirmation}
|
disabled={isUpdating || isRequestingConfirmation || !hasChanges}
|
||||||
loading={isUpdating || isRequestingConfirmation}
|
loading={isUpdating || isRequestingConfirmation}
|
||||||
onClick={onSave}
|
onClick={onSave}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user