Skip to content

Commit b8c0e1b

Browse files
authored
fix: keep award page revalidation enabled
1 parent 29dcf99 commit b8c0e1b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎pages/award/index.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { GetStaticProps } from 'next';
22
import { FC } from 'react';
3+
import { Minute, Second } from 'web-utility';
34

45
import { Award, AwardModel } from '../../models/Award';
56
import { hasLarkServerAccess } from '../../models/configuration';
67
import { lark } from '../api/Lark/core';
78

89
export const getStaticProps: GetStaticProps<{ awards: Award[] }> = async () => {
9-
if (!hasLarkServerAccess) return { props: { awards: [] } };
10+
if (!hasLarkServerAccess) return { props: { awards: [] }, revalidate: Minute / Second };
1011

1112
await lark.getAccessToken();
1213

@@ -15,7 +16,7 @@ export const getStaticProps: GetStaticProps<{ awards: Award[] }> = async () => {
1516

1617
const awards = await store.getAll();
1718

18-
return { props: { awards } };
19+
return { props: { awards }, revalidate: Minute / Second };
1920
};
2021

2122
const AwardPage: FC = () => <></>;

0 commit comments

Comments
 (0)