Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verified flag is also updated on edited invoice object #242

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions frontend/src/components/invoice/invoice-edit/EditInvoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ const EditInvoice = () => {
)}
<EditInvoiceSaveButtons
onClick={(type, navigate) => {
// When the InvoiceNotVerifiedAlert component updates the verified flag to true on initInvoice,
// it doesn't update on the edited object invoice. So the verified flag is overridden when you save
// the edited object invoice. This if check fixes that
if (initInvoice.verified !== invoice.verified) {
invoice.verified = initInvoice.verified;
}
if (type === 'create') {
dispatch(createInvoice(invoice, navigate) as any);
} if (type === 'preview') {
Expand Down