File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
src/frontend/apps/impress/src/pages Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,17 @@ const Page: NextPageWithLayout = () => {
19
19
const { t } = useTranslation ( ) ;
20
20
21
21
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 ) ) ;
25
32
26
- console . log ( itemsResponse ) ;
27
33
} , [ ] ) ;
28
34
29
35
return (
@@ -52,7 +58,6 @@ const Page: NextPageWithLayout = () => {
52
58
53
59
< StyledButton
54
60
onClick = { ( ) => fetchFromZotero ( ) }
55
-
56
61
icon = { < Icon iconName = "house" $color = "white" /> } >
57
62
{ t ( 'Home' ) }
58
63
</ StyledButton >
You can’t perform that action at this time.
0 commit comments