From ad082d8e207fc427e86844657e34bd7518760331 Mon Sep 17 00:00:00 2001 From: Alexandre Monjol Date: Tue, 28 May 2024 12:06:50 +0200 Subject: [PATCH] misc: add success toast on manual netsuite sync --- ditto/base.json | 1 + src/layouts/CustomerInvoiceDetails.tsx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/ditto/base.json b/ditto/base.json index 50e6eebcf..0e294089e 100644 --- a/ditto/base.json +++ b/ditto/base.json @@ -432,6 +432,7 @@ "text_66461b36b4b38c006e8b5068": "To link Lago credit notes with NetSuite, please choose the corresponding credit note item in your NetSuite account.", "text_6650b36fc702a4014c878996": "Connected to external apps", "text_6650b36fc702a4014c87899a": "Netsuite invoice url", + "text_6655a88569eed300ee8c4d44": "NetSuite synchronisation successfully triggered.", "text_6650b36fc702a4014c8788fd": "Sync invoice to NetSuite", "text_62f50d3cc15266f3bd1d83ce": "Infos copied to clipboard", "text_62f50d26c989ab0319688498": "Environment information", diff --git a/src/layouts/CustomerInvoiceDetails.tsx b/src/layouts/CustomerInvoiceDetails.tsx index 500627950..d103b087d 100644 --- a/src/layouts/CustomerInvoiceDetails.tsx +++ b/src/layouts/CustomerInvoiceDetails.tsx @@ -212,6 +212,14 @@ const CustomerInvoiceDetails = () => { const [syncIntegrationInvoice, { loading: loadingSyncIntegrationInvoice }] = useSyncIntegrationInvoiceMutation({ variables: { input: { invoiceId: invoiceId || '' } }, + onCompleted({ syncIntegrationInvoice: syncIntegrationInvoiceResult }) { + if (syncIntegrationInvoiceResult?.invoiceId) { + addToast({ + severity: 'success', + translateKey: 'text_6655a88569eed300ee8c4d44', + }) + } + }, }) const [downloadInvoice, { loading: loadingInvoiceDownload }] = useDownloadInvoiceMutation({