From 5f332cd3658b669b1b9ef63e9dbc97cec427e6af Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Mon, 14 Feb 2022 10:22:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=20Simplify=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/features/log/Log.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/features/log/Log.tsx b/frontend/src/features/log/Log.tsx index 7331ddf..5a67534 100644 --- a/frontend/src/features/log/Log.tsx +++ b/frontend/src/features/log/Log.tsx @@ -3,7 +3,7 @@ import clsx from "clsx"; import React from "react"; import { useUrlSearchParams } from "use-url-search-params"; -import { Order, OrderLine, OrderListDocument, Transaction, TransactionListDocument } from "../../types"; +import { OrderListDocument, TransactionListDocument } from "../../types"; import { formatTime } from "../../utils/time"; import styles from "./Log.module.css"; @@ -44,13 +44,12 @@ export const Log = () => { - {/* @ts-expect-error The graphql query is not fetching all the fields, so the types are not overlapping */} - {orders.map((order: Order) => ( + {orders.map((order) => ( {formatTime(order.created)} {order.isExternal ? "Ekstern" : `${order.customer?.firstName} ${order.customer?.lastName}`} - {(order.orderlines ?? []).map((line: OrderLine) => ( + {(order.orderlines ?? []).map((line) => (
{line.amount}x {line.product.name}
@@ -101,8 +100,7 @@ export const Log = () => { - {/* @ts-expect-error The graphql query is not fetching all the fields, so the types are not overlapping */} - {transactions.map((trans: Transaction) => ( + {transactions.map((trans) => ( {formatTime(trans.created)}