-
-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fetch): include status code in
fetch
client response (#1470)
* feat(fetch): include http status code in `fetch` response * chore: rerun `orval` in next sample app * chore: update return object in custom fetch function * chore: display http status code in next sample app
- Loading branch information
1 parent
d5592b6
commit 9404af4
Showing
4 changed files
with
50 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import { listPets } from './gen/pets/pets'; | ||
|
||
export default async function Pets() { | ||
const pets = await listPets(); | ||
const { data: pets, status } = await listPets(); | ||
|
||
return ( | ||
<div> | ||
<h1 className="text-4xl">Pets by server actions</h1> | ||
|
||
<ul> | ||
{pets.map((pet) => ( | ||
<li key={pet.id}>{pet.name}</li> | ||
))} | ||
</ul> | ||
|
||
<h2 className="text-xl">Status: {status}</h2> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters