Skip to content

Commit b582e7b

Browse files
committed
fix: resolve type issue
1 parent 1e48a26 commit b582e7b

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

package-lock.json

+12-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@angular/platform-browser": "^17.3.0",
2020
"@angular/platform-browser-dynamic": "^17.3.0",
2121
"@angular/router": "^17.3.0",
22-
"openapi-fetch-angular": "^0.0.1",
22+
"openapi-fetch-angular": "^0.0.2",
2323
"rxjs": "~7.8.0",
2424
"tslib": "^2.3.0",
2525
"zone.js": "~0.14.3"

src/app/app.component.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ export class AppComponent implements OnInit {
1515
constructor(private testApi: TestAPIService) {}
1616

1717
async ngOnInit(): Promise<void> {
18-
const { data, error } = await this.testApi.post('/pet/findByStatus');
18+
const { data, error } = await this.testApi.get('/pet/{petId}', {
19+
params: { path: { petId: 1 } },
20+
});
1921

20-
console.log(data, error);
22+
if (error) {
23+
console.log('Error! Could not fetch data!');
24+
return;
25+
}
26+
27+
console.log('Data fetched successfully!', data);
2128
}
2229
}

0 commit comments

Comments
 (0)