Skip to content

Commit 1ddd39f

Browse files
committed
chore: add pkg.pr.new badge
1 parent 2fba59a commit 1ddd39f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ See [the online playground](https://typed-openapi-astahmer.vercel.app/)
66

77
![Screenshot 2023-08-08 at 00 48 42](https://github.com/astahmer/typed-openapi/assets/47224540/3016fa92-e09a-41f3-a95f-32caa41325da)
88

9+
[![pkg.pr.new](https://pkg.pr.new/badge/astahmer/typed-openapi)](https://pkg.pr.new/~/astahmer/typed-openapi)
10+
911
## Features
1012

1113
- Headless API client, bring your own fetcher ! (fetch, axios, ky, etc...)

packages/typed-openapi/TANSTACK_QUERY_ERROR_HANDLING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function CreateUserForm() {
9595
// error is fully typed based on your OpenAPI spec!
9696
// error is also a Response instance with additional data property
9797
console.log(error instanceof Response); // true
98-
98+
9999
if (error.status === 400) {
100100
// error.data is typed as ValidationError
101101
console.error('Validation failed:', error.data.message);
@@ -144,7 +144,7 @@ function AdvancedCreateUserForm() {
144144
// error is also a Response instance
145145
console.log(error.ok); // false
146146
console.log(error.headers); // Response headers
147-
147+
148148
switch (error.status) {
149149
case 400:
150150
toast.error(`Validation: ${error.data.fields.join(', ')}`);

packages/typed-openapi/TANSTACK_QUERY_EXAMPLES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function UserForm() {
131131
// Type-safe error handling - error is a Response-like object with data property
132132
console.log(error instanceof Response); // true
133133
console.log(error.ok); // false
134-
134+
135135
if (error.status === 400) {
136136
toast.error(`Validation failed: ${error.data.message}`);
137137
} else if (error.status === 500) {

0 commit comments

Comments
 (0)