forked from templates/nextjs-template
style: Обновление код стайла
This commit is contained in:
21
ai/nextjs-style-guide/applied/rest-client/usage.md
Normal file
21
ai/nextjs-style-guide/applied/rest-client/usage.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Использование REST-клиента
|
||||
description: Как вызвать готовый REST-клиент в функции.
|
||||
keywords: [rest, api client, submit, generated, pet-store-api]
|
||||
---
|
||||
|
||||
# Использование REST-клиента
|
||||
|
||||
Как вызвать готовый REST-клиент в функции.
|
||||
|
||||
## Пример
|
||||
|
||||
```ts
|
||||
import { petStoreApi } from 'infra/pet-store-api'
|
||||
|
||||
export const getPet = async (petId: number) => {
|
||||
const pet = await petStoreApi.pet.getPetById({ petId })
|
||||
|
||||
console.log(pet)
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user