From d077cae17c12bbd90beafa7d9d85739f6517d82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Qu=E1=BB=91c=20Kh=C3=A1nh?= Date: Sun, 14 Jul 2024 02:26:30 +0700 Subject: [PATCH] fix(mobile): [Transaction] new transaction amount should be negative (#104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(api): [Transaction] Paginate transactions by date instead of createdAt * fix(mobile): new transaction amount should be negative --------- Co-authored-by: Quốc Khánh --- apps/mobile/mutations/transaction.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/mobile/mutations/transaction.ts b/apps/mobile/mutations/transaction.ts index 198e4db7..622821fe 100644 --- a/apps/mobile/mutations/transaction.ts +++ b/apps/mobile/mutations/transaction.ts @@ -5,7 +5,10 @@ import { z } from 'zod' export async function createTransaction(data: TransactionFormValues) { const hc = await getHonoClient() const result = await hc.v1.transactions.$post({ - json: data, + json: { + ...data, + amount: -data.amount, + }, }) if (result.ok) {