IO-2297 added optimistic response and click outside function

This commit is contained in:
swtmply
2023-05-24 03:17:41 +08:00
parent 8f91416623
commit 5e96ccdd99
3 changed files with 15 additions and 9 deletions

View File

@@ -25,6 +25,7 @@ export default function ProductionListDate({
// }
//e.stopPropagation();
updateAlert({
variables: {
jobId: record.id,
@@ -32,6 +33,11 @@ export default function ProductionListDate({
[field]: date,
},
},
optimisticResponse: {
update_jobs: {
[field]: date,
},
},
}).then(() => {
if (record.refetch) record.refetch();
if (!time) {
@@ -49,9 +55,11 @@ export default function ProductionListDate({
(moment().add(1, "day").isSame(moment(record[field]), "day") &&
"production-completion-soon"));
}
return (
<Dropdown
//trigger={["click"]}
trigger={["click"]}
onVisibleChange={(v) => setVisible(v)}
visible={visible}
style={{
height: "19px",