@layerfi/components 0.1.70 → 0.1.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5049,7 +5049,6 @@ declare module '@layerfi/components/types/bank_transactions' {
5049
5049
  suggested_matches?: SuggestedMatch[];
5050
5050
  match?: BankTransactionMatch;
5051
5051
  document_ids: String[];
5052
- metadata: BankTransactionMetadata;
5053
5052
  }
5054
5053
  export interface SuggestedMatch {
5055
5054
  id: string;
package/dist/index.js CHANGED
@@ -10574,6 +10574,21 @@ var ExpandedBankTransactionRow = (0, import_react113.forwardRef)(
10574
10574
  }));
10575
10575
  setReceiptUrls(retrievedDocs);
10576
10576
  };
10577
+ const fetchMemos = async () => {
10578
+ const getBankTransactionMetadata2 = Layer.getBankTransactionMetadata(
10579
+ apiUrl,
10580
+ auth.access_token,
10581
+ {
10582
+ params: {
10583
+ businessId,
10584
+ bankTransactionId: bankTransaction.id
10585
+ }
10586
+ }
10587
+ );
10588
+ const result = await getBankTransactionMetadata2();
10589
+ if (result.data.memo)
10590
+ setMemoText(result.data.memo);
10591
+ };
10577
10592
  const readDate = (date) => {
10578
10593
  if (!date)
10579
10594
  return void 0;
@@ -10611,6 +10626,9 @@ var ExpandedBankTransactionRow = (0, import_react113.forwardRef)(
10611
10626
  if (isOpen && isLoaded && receiptUrls.length === 0 && bankTransaction?.document_ids?.length > 0) {
10612
10627
  fetchDocuments();
10613
10628
  }
10629
+ if (isOpen && isLoaded) {
10630
+ fetchMemos();
10631
+ }
10614
10632
  }, [isOpen]);
10615
10633
  (0, import_react113.useEffect)(() => {
10616
10634
  if (!isLoaded) {
@@ -10626,8 +10644,8 @@ var ExpandedBankTransactionRow = (0, import_react113.forwardRef)(
10626
10644
  }, [getDivHeight, isOpen]);
10627
10645
  (0, import_react113.useEffect)(() => {
10628
10646
  const loadDocumentsAndMetadata = async () => {
10629
- if (showDescriptions && bankTransaction?.metadata.memo)
10630
- setMemoText(bankTransaction?.metadata.memo);
10647
+ if (showDescriptions && isOpen)
10648
+ await fetchMemos();
10631
10649
  if (showReceiptUploads && bankTransaction?.document_ids?.length > 0 && isOpen)
10632
10650
  await fetchDocuments();
10633
10651
  setIsLoaded(true);