Skip to content

Commit

Permalink
Fix updating entry date by acually passing correct original date in m…
Browse files Browse the repository at this point in the history
…utation
  • Loading branch information
joonashak committed Mar 19, 2024
1 parent 84ddbb8 commit 8d9dacd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/components/entry-dialog/EntryDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ const EntryDialog = ({ editEntry, date, onClose, ...props }: EntryDialogProps) =
};

const editWorkday: SubmitHandler<EntryFormSchema> = async (formValues) => {
const { date, duration, description, product, activity, issue, client } = formValues;
const { date: newDate, duration, description, product, activity, issue, client } = formValues;

if (!editEntry) {
throw new Error("Original entry not given.");
}

await replaceWorkdayEntryMutation({
variables: {
originalEntry: { key: editEntry.key, date: date.format("YYYY-MM-DD") },
originalEntry: { key: editEntry.key, date: date?.format("YYYY-MM-DD") },
replacementEntry: {
date: date.format("YYYY-MM-DD"),
date: newDate.format("YYYY-MM-DD"),
duration: Number(duration),
description,
product,
Expand Down

0 comments on commit 8d9dacd

Please sign in to comment.