Skip to content

Commit 3ec342a

Browse files
committed
fixup! 🚧(project) add zotero connector to call api
1 parent 9841e55 commit 3ec342a

File tree

1 file changed

+10
-5
lines changed
  • src/frontend/apps/impress/src/pages

1 file changed

+10
-5
lines changed

src/frontend/apps/impress/src/pages/404.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ const Page: NextPageWithLayout = () => {
1919
const { t } = useTranslation();
2020

2121
const fetchFromZotero = useCallback(async () => {
22-
const apiKey = '';
23-
const myapi = api(apiKey).library('user', 475425); //
24-
const itemsResponse = await myapi.items().get();
22+
const apiKey = process.env.NEXT_PUBLIC_ZOTERO_API_KEY;
23+
const userId = process.env.NEXT_PUBLIC_ZOTERO_USER_ID;
24+
25+
const myapi = api(apiKey).library('user', userId);
26+
27+
const response = await myapi.items().get();
28+
29+
const items = response.getData();
30+
31+
console.log(items.map(i => i.title));
2532

26-
console.log(itemsResponse);
2733
}, []);
2834

2935
return (
@@ -52,7 +58,6 @@ const Page: NextPageWithLayout = () => {
5258

5359
<StyledButton
5460
onClick={() => fetchFromZotero()}
55-
5661
icon={<Icon iconName="house" $color="white" />}>
5762
{t('Home')}
5863
</StyledButton>

0 commit comments

Comments
 (0)