Skip to content

Commit

Permalink
feat: pick ledger id by ledger selector instead path params
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcastr0 committed Feb 25, 2025
1 parent 65801a4 commit 8259d74
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/app/(routes)/assets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,20 @@ const Page = () => {
const intl = useIntl()
const { id: ledgerId } = useParams<{ id: string }>()
const [columnFilters, setColumnFilters] = useState<any>([])
const { currentOrganization, currentLedgerId } = useOrganization()
const { currentOrganization, currentLedger } = useOrganization()
const { showSuccess, showError } = useCustomToast()
const { handleCreate, handleEdit, sheetProps } = useCreateUpdateSheet<any>()
const [total, setTotal] = useState(0)

const { form, searchValues, pagination } = useQueryParams({ total })

console.log('currentOrg-> ', currentOrganization)
console.log('currentLedger-> ', currentLedgerId)

const {
data: assets,
refetch,
isLoading
} = useListAssets({
organizationId: currentOrganization.id!,
ledgerId: currentLedgerId,
ledgerId: currentLedger.id,
...(searchValues as any)
})

Expand All @@ -53,7 +50,7 @@ const Page = () => {

const { mutate: deleteMutate, isPending: deletePending } = useDeleteAsset({
organizationId: currentOrganization.id!,
ledgerId,
ledgerId: currentLedger.id,
onSuccess: () => {
handleDialogClose()
refetch()
Expand Down Expand Up @@ -103,10 +100,7 @@ const Page = () => {
name: currentOrganization.legalName
},
{
name: intl.formatMessage({
id: `ledgers.title`,
defaultMessage: 'Ledgers'
})
name: currentLedger.name
},
{
name: intl.formatMessage({
Expand Down

0 comments on commit 8259d74

Please sign in to comment.