From b583d3706aa7f6374df80d7e813cd8e1acbaba1d Mon Sep 17 00:00:00 2001 From: Khaliq Date: Fri, 27 Sep 2024 16:51:25 +0300 Subject: [PATCH] [nan-1763] succinctness Co-authored-by: Thomas Bonnin <233326+TBonnin@users.noreply.github.com> --- integrations/xero/mappers/to-item.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/integrations/xero/mappers/to-item.ts b/integrations/xero/mappers/to-item.ts index 3e03e028..16f0ebd3 100644 --- a/integrations/xero/mappers/to-item.ts +++ b/integrations/xero/mappers/to-item.ts @@ -40,10 +40,8 @@ export function toXeroItem(item: Item) { } export function toFailedItem(xeroItem: XeroItem): FailedItem { - const failedItem = toItem(xeroItem); - const failedItemWithValidationErrors: FailedItem = { - ...failedItem, - validation_errors: xeroItem?.ValidationErrors || [] - }; - return failedItemWithValidationErrors; + return { + ...(toItem(xeroItem)) + validation_errors: xeroItem?.ValidationErrors || [] + } }