Skip to content

Commit

Permalink
fix(chat): increases publication listing limit param (Part 1) (Issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Kezik authored Feb 3, 2025
1 parent 59897a4 commit 8b6f709
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions apps/chat/src/pages/api/publication/[entitytype]/[...slug].ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {

const url = getEntityUrlFromSlugs(process.env.DIAL_API_HOST, req);

const { recursive = false } = req.query as {
const { recursive = false, limit = 1000 } = req.query as {
recursive?: string;
limit?: number;
};

const session = await getServerSession(req, res, authOptions);
Expand All @@ -61,9 +62,12 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const token = await getToken({ req });

try {
const proxyRes = await fetch(`${url}/?recursive=${recursive}`, {
headers: getApiHeaders({ jwt: token?.access_token as string }),
});
const proxyRes = await fetch(
`${url}/?recursive=${recursive}&limit=${limit}`,
{
headers: getApiHeaders({ jwt: token?.access_token as string }),
},
);

let json: unknown;
if (!proxyRes.ok) {
Expand Down

0 comments on commit 8b6f709

Please sign in to comment.