Skip to content

Commit

Permalink
⏪️ reverserer kall for søknader
Browse files Browse the repository at this point in the history
Co-authored-by: Tor Idland <[email protected]>
  • Loading branch information
thomasrognes and tidnav committed Jan 25, 2024
1 parent 93a6e11 commit b4aa73d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pages/ettersendelse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ export const getServerSideProps = beskyttetSide(async (ctx: NextPageContext): Pr
path: '/ettersendelse',
});
const bearerToken = getAccessToken(ctx);
const søknader = await getSøknader(bearerToken);
const params = { page: '0', size: '1', sort: 'created,desc' };
const søknader = await getSøknader(params, bearerToken);
stopTimer();

if (søknader.length > 0) {
Expand Down
4 changes: 3 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ export const getServerSideProps = beskyttetSide(async (ctx: NextPageContext): Pr
const stopTimer = metrics.getServersidePropsDurationHistogram.startTimer({ path: '/' });
const bearerToken = getAccessToken(ctx);

const søknader = await getSøknader(bearerToken);
const params = { page: '0', size: '1', sort: 'created,desc' };

const [søknader] = await Promise.all([getSøknader(params, bearerToken)]);

stopTimer();

Expand Down
4 changes: 3 additions & 1 deletion pages/soknader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ const Søknader = ({ søknader }: PageProps) => {
export const getServerSideProps = beskyttetSide(async (ctx: NextPageContext): Promise<GetServerSidePropsResult<{}>> => {
const stopTimer = metrics.getServersidePropsDurationHistogram.startTimer({ path: '/soknader' });
const bearerToken = getAccessToken(ctx);
const søknader = await getSøknader(bearerToken);
const params = { page: '0', size: '1', sort: 'created,desc' };

const [søknader] = await Promise.all([getSøknader(params, bearerToken)]);

logger.info(`søknader: ${JSON.stringify(søknader)}`);

Expand Down

0 comments on commit b4aa73d

Please sign in to comment.