[offers][fix] fix types for list some offers (#391)

pull/394/head
Zhang Ziqing 2 years ago committed by GitHub
parent bc424bee33
commit 3209f8ef7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,8 +1,9 @@
import Link from 'next/link'; import Link from 'next/link';
import type { DashboardOffer } from '../../../types/offers'; import { convertCurrencyToString } from '~/utils/offers/currency';
import { convertCurrencyToString } from '../../../utils/offers/currency'; import { formatDate } from '~/utils/offers/time';
import { formatDate } from '../../../utils/offers/time';
import type { DashboardOffer } from '~/types/offers';
export type OfferTableRowProps = Readonly<{ row: DashboardOffer }>; export type OfferTableRowProps = Readonly<{ row: DashboardOffer }>;

@ -9,7 +9,7 @@ import { trpc } from '~/utils/trpc';
import OffersRow from './OffersRow'; import OffersRow from './OffersRow';
import type { DashboardOffer, Paging } from '~/types/offers'; import type { DashboardOffer, GetOffersResponse, Paging } from '~/types/offers';
const NUMBER_OF_OFFERS_IN_PAGE = 10; const NUMBER_OF_OFFERS_IN_PAGE = 10;
export type OffersTableProps = Readonly<{ export type OffersTableProps = Readonly<{
@ -52,18 +52,7 @@ export default function OffersTable({
}, },
], ],
{ {
onSuccess: (response) => { onSuccess: (response: GetOffersResponse) => {
// Const filteredData = response.data.map((res) => {
// return {
// company: res.company.name,
// date: res.monthYearReceived,
// id: res.id,
// profileId: res.profileId,
// income: res.income,
// title: res.title,
// yoe: res.totalYoe,
// };
// });
setOffers(response.data); setOffers(response.data);
setPagination(response.paging); setPagination(response.paging);
}, },

Loading…
Cancel
Save