diff --git a/code/allapp/allapp-go/utils/pgtypex/pgtypex.go b/code/allapp/allapp-go/utils/pgtypex/pgtypex.go
index 92c1aa1c..d981dbb6 100644
--- a/code/allapp/allapp-go/utils/pgtypex/pgtypex.go
+++ b/code/allapp/allapp-go/utils/pgtypex/pgtypex.go
@@ -129,6 +129,9 @@ func TimestampToMillis(ts pgtype.Timestamp) int64 {
return ts.Time.UnixMilli()
}
-func DateToString(s pgtype.Date) string {
- return s.Time.String()
+func DateToString(d pgtype.Date) string {
+ if !d.Valid {
+ return ""
+ }
+ return d.Time.Format("2006-01-02")
}
diff --git a/code/allapp/allapp-rn/src/app/(tabs)/money/components/TransactionsList.tsx b/code/allapp/allapp-rn/src/app/(tabs)/money/components/TransactionsList.tsx
index 6baed1fe..6225ea08 100644
--- a/code/allapp/allapp-rn/src/app/(tabs)/money/components/TransactionsList.tsx
+++ b/code/allapp/allapp-rn/src/app/(tabs)/money/components/TransactionsList.tsx
@@ -1,4 +1,4 @@
-import type { MoneyRecordGroup, MoneyRecordItem } from '@/types/money/record'
+import type { MoneyRecord, MoneyRecordGroup } from '@/types/money/record'
import React, { useCallback, useState } from 'react'
import { RefreshControl, SectionList, Text, TouchableHighlight, Vibration, View } from 'react-native'
import {
@@ -11,11 +11,13 @@ import {
import { LucideIcon } from '@/components/common/ao'
import EmptyState from '@/components/common/EmptyStatus'
import MoneyCategoryIcon from '@/components/common/MoneyCategoryIcon'
+import { useMoneyCategoryStore } from '@/store/moneyCategory'
import { useUserStore } from '@/store/user'
+import { MoneyCategoryEnum } from '@/types/money/category'
interface StaticTransactionsProps {
records: MoneyRecordGroup[]
- onUpdate?: (data: MoneyRecordItem) => void
+ onUpdate?: (data: MoneyRecord) => void
onDelete?: (id: number) => void
onDetail?: (id: number) => void
onRefreshData?: () => void
@@ -30,6 +32,7 @@ export default function StaticTransactions({
onLoadMore,
onRefreshData,
}: StaticTransactionsProps) {
+ const moneyCategoryStore = useMoneyCategoryStore()
const userID = useUserStore().userInfo?.id
const [refreshing, setRefreshing] = useState(false)
const [loadingMore, setLoadingMore] = useState(false)
@@ -119,6 +122,7 @@ export default function StaticTransactions({
)}
renderItem={({ item }) => {
+ const category = moneyCategoryStore.getCategoryById(item.category_id)
return (