File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change
1
+ {}
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
- import logo from './logo.svg' ;
3
- import './App.css' ;
1
+ import "./App.css" ;
2
+ import { Configuration , PostsApi } from "./generated-sources/openapi" ;
3
+
4
+ const configuration = new Configuration ( {
5
+ basePath : window . location . origin ,
6
+ credentials : "same-origin" ,
7
+ } ) ;
8
+
9
+ const postsApi = new PostsApi ( configuration ) ;
10
+
11
+ const App = ( ) => {
12
+ const onClick = ( ) => {
13
+ postsApi . getPosts ( ) ;
14
+ } ;
4
15
5
- function App ( ) {
6
16
return (
7
17
< div className = "App" >
8
18
< header className = "App-header" >
9
- < img src = { logo } className = "App-logo" alt = "logo" />
10
- < p >
11
- Edit < code > src/App.tsx</ code > and save to reload.
12
- </ p >
13
- < a
14
- className = "App-link"
15
- href = "https://reactjs.org"
16
- target = "_blank"
17
- rel = "noopener noreferrer"
18
- >
19
- Learn React
20
- </ a >
19
+ < button onClick = { onClick } > Get Posts</ button >
21
20
</ header >
22
21
</ div >
23
22
) ;
24
- }
23
+ } ;
25
24
26
25
export default App ;
You can’t perform that action at this time.
0 commit comments