после загрузки основного функционала
This commit is contained in:
@@ -50,6 +50,12 @@ export interface PageControl<T>{
|
||||
nextPage(): void;
|
||||
previousPage(): void;
|
||||
}
|
||||
export interface FieldInfo {
|
||||
name: string;
|
||||
type: string;
|
||||
title: string;
|
||||
format?: string;
|
||||
}
|
||||
```
|
||||
`types/survey.ts`
|
||||
```ts
|
||||
@@ -113,12 +119,10 @@ export interface ContactData{
|
||||
phone?: string;
|
||||
email?:string;
|
||||
}
|
||||
interface Role extends UniqueItem{
|
||||
title: string;
|
||||
}
|
||||
export interface Account extends UniqueItem, ContactData{
|
||||
login: string;
|
||||
role?: Role;
|
||||
role?: number;
|
||||
roleTitle?: string;
|
||||
is_staff: boolean;
|
||||
is_active: boolean;
|
||||
}
|
||||
@@ -235,6 +239,21 @@ export function ProfessionPage() {
|
||||
}
|
||||
```
|
||||
|
||||
### Автодокументация
|
||||
`api/hooks.ts`
|
||||
```ts
|
||||
/**
|
||||
* Хук для получения документации swagger JSON и извлечения структур.
|
||||
* @param applicationName Название модуля/приложения.
|
||||
* @param endpointName Название эндпоинта.
|
||||
* @returns Массив структур без ID с полями: название, тип, title, format.
|
||||
*/
|
||||
export function useApiDocumentation(
|
||||
applicationName: string,
|
||||
endpointName: string
|
||||
): { schema: FieldInfo[] | null; loading: boolean; error: Error | null }
|
||||
```
|
||||
|
||||
|
||||
### Авторизация
|
||||
|
||||
|
||||
Reference in New Issue
Block a user