aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/admin/list/TableActive.tsx6
-rw-r--r--packages/merchant-backoffice-ui/src/utils/amount.ts14
-rw-r--r--packages/merchant-backoffice-ui/src/utils/table.ts4
3 files changed, 11 insertions, 13 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/admin/list/TableActive.tsx b/packages/merchant-backoffice-ui/src/paths/admin/list/TableActive.tsx
index 928658910..56b3f299c 100644
--- a/packages/merchant-backoffice-ui/src/paths/admin/list/TableActive.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/admin/list/TableActive.tsx
@@ -175,10 +175,8 @@ function notEmpty<TValue>(value: TValue | null | undefined): value is TValue {
return value !== null && value !== undefined;
}
-function buildActions(intances: MerchantBackend.Instances.Instance[], selected: string[], action: 'DELETE'): Actions[] {
- return selected.map(id => intances.find(i => i.id === id))
+function buildActions(instances: MerchantBackend.Instances.Instance[], selected: string[], action: 'DELETE'): Actions[] {
+ return selected.map(id => instances.find(i => i.id === id))
.filter(notEmpty)
.map(id => ({ element: id, type: action }))
}
-
-
diff --git a/packages/merchant-backoffice-ui/src/utils/amount.ts b/packages/merchant-backoffice-ui/src/utils/amount.ts
index 61e33129c..1cfd5c1d1 100644
--- a/packages/merchant-backoffice-ui/src/utils/amount.ts
+++ b/packages/merchant-backoffice-ui/src/utils/amount.ts
@@ -17,10 +17,10 @@ import { amountFractionalBase, AmountJson, Amounts } from "@gnu-taler/taler-util
import { MerchantBackend } from "../declaration";
/**
- * sums two prices,
- * @param one
- * @param two
- * @returns
+ * sums two prices,
+ * @param one
+ * @param two
+ * @returns
*/
const sumPrices = (one: string, two: string) => {
const [currency, valueOne] = one.split(':')
@@ -30,7 +30,7 @@ const sumPrices = (one: string, two: string) => {
/**
* merge refund with the same description and a difference less than one minute
- * @param prev list of refunds that will hold the merged refunds
+ * @param prev list of refunds that will hold the merged refunds
* @param cur new refund to add to the list
* @returns list with the new refund, may be merged with the last
*/
@@ -38,8 +38,8 @@ export function mergeRefunds(prev: MerchantBackend.Orders.RefundDetails[], cur:
let tail;
if (prev.length === 0 || //empty list
- cur.timestamp.t_s === 'never' || //current doesnt have timestamp
- (tail = prev[prev.length - 1]).timestamp.t_s === 'never' || // last doesnt have timestamp
+ cur.timestamp.t_s === 'never' || //current does not have timestamp
+ (tail = prev[prev.length - 1]).timestamp.t_s === 'never' || // last does not have timestamp
cur.reason !== tail.reason || //different reason
cur.pending !== tail.pending || //different pending state
Math.abs(cur.timestamp.t_s - tail.timestamp.t_s) > 1000 * 60) {//more than 1 minute difference
diff --git a/packages/merchant-backoffice-ui/src/utils/table.ts b/packages/merchant-backoffice-ui/src/utils/table.ts
index 3d713a6f7..198c46543 100644
--- a/packages/merchant-backoffice-ui/src/utils/table.ts
+++ b/packages/merchant-backoffice-ui/src/utils/table.ts
@@ -30,8 +30,8 @@ function notEmpty<TValue>(value: TValue | null | undefined): value is TValue {
return value !== null && value !== undefined;
}
-export function buildActions<T extends WithId>(intances: T[], selected: string[], action: 'DELETE'): Actions<T>[] {
- return selected.map(id => intances.find(i => i.id === id))
+export function buildActions<T extends WithId>(instances: T[], selected: string[], action: 'DELETE'): Actions<T>[] {
+ return selected.map(id => instances.find(i => i.id === id))
.filter(notEmpty)
.map(id => ({ element: id, type: action }))
}