rename function

This commit is contained in:
smanylov
2026-05-18 11:51:56 +07:00
parent bfc457470c
commit 55915af9df
4 changed files with 31 additions and 31 deletions
+1 -1
View File
@@ -672,7 +672,7 @@ export interface ComplaintsCaseQueryParams {
sort_direction?: 'desc' | 'asc' sort_direction?: 'desc' | 'asc'
} }
export async function fetchLastCase(params: ComplaintsCaseQueryParams) { export async function fetchLastClaims(params: ComplaintsCaseQueryParams) {
const token = await getSessionData('token'); const token = await getSessionData('token');
const { page, size, sort_by, sort_direction } = params; const { page, size, sort_by, sort_direction } = params;
+2 -2
View File
@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { fetchLastCase, ComplaintsCaseQueryParams } from '@/app/actions/violationActions'; import { fetchLastClaims, ComplaintsCaseQueryParams } from '@/app/actions/violationActions';
export interface Case { export interface Case {
amount: number; amount: number;
@@ -31,7 +31,7 @@ export const useLastCases = (params: ComplaintsCaseQueryParams) => {
return useQuery({ return useQuery({
queryKey: ['lastCases', params.page, params.size, params.sort_by, params.sort_direction], queryKey: ['lastCases', params.page, params.size, params.sort_by, params.sort_direction],
queryFn: () => { queryFn: () => {
return fetchLastCase(params) return fetchLastClaims(params)
}, },
select: (data: useLastCase | null) => { select: (data: useLastCase | null) => {
if (!data) { if (!data) {
@@ -1,6 +1,6 @@
'use client' 'use client'
import { useState, useMemo, useCallback } from 'react'; import { useState, useMemo } from 'react';
import { import {
useReactTable, useReactTable,
getCoreRowModel, getCoreRowModel,
@@ -91,33 +91,33 @@ export function ViolationsMyComplaintsTable() {
</div> </div>
), ),
}, },
/* { /* {
accessorKey: 'createdAt', accessorKey: 'createdAt',
header: ({ column }) => ( header: ({ column }) => (
<div className="column"> <div className="column">
<span>{t('date-of-creation')}</span> <span>{t('date-of-creation')}</span>
<button <button
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')} onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
className="sort-button hidden" className="sort-button hidden"
> >
{column.getIsSorted() === 'asc' ? ( {column.getIsSorted() === 'asc' ? (
<IconArrowUp /> <IconArrowUp />
) : column.getIsSorted() === 'desc' ? ( ) : column.getIsSorted() === 'desc' ? (
<IconArrowDown /> <IconArrowDown />
) : ( ) : (
<IconFilter /> <IconFilter />
)} )}
</button> </button>
</div> </div>
), ),
cell: ({ row }) => ( cell: ({ row }) => (
<div className="text-center table-item"> <div className="text-center table-item">
{formatDate(new Date(row.original.created_at).getTime())} {formatDate(new Date(row.original.created_at).getTime())}
<br /> <br />
{formatDateTime(new Date(row.original.created_at).getTime())} {formatDateTime(new Date(row.original.created_at).getTime())}
</div> </div>
), ),
}, */ }, */
{ {
accessorKey: 'updatedAt', accessorKey: 'updatedAt',
header: ({ column }) => ( header: ({ column }) => (