mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-29 13:13:54 +08:00
[offers][chore] Add total number of offers in paging information
This commit is contained in:
@ -14,17 +14,7 @@ function Test() {
|
||||
},
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ul>
|
||||
{data.data?.data.map((x) => {
|
||||
return <li key={x.id}>{JSON.stringify(x)}</li>;
|
||||
})}
|
||||
</ul>
|
||||
<br />
|
||||
<p>{JSON.stringify(data.data?.paging)}</p>
|
||||
</>
|
||||
);
|
||||
return <>{JSON.stringify(data.data)}</>;
|
||||
}
|
||||
|
||||
export default Test;
|
||||
|
@ -333,6 +333,7 @@ export const offersRouter = createRouter().query('list', {
|
||||
currPage: input.offset,
|
||||
numOfItemsInPage: paginatedData.length,
|
||||
numOfPages: Math.ceil(data.length / input.limit),
|
||||
totalNumberOfOffers: data.length,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
Reference in New Issue
Block a user