decompose structure
This commit is contained in:
8
src/entities/tag/api.ts
Normal file
8
src/entities/tag/api.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { getJson } from '../../shared/api/http';
|
||||
import { cloudApiUrl } from '../../shared/config/env';
|
||||
import type { TagResponse } from './types';
|
||||
|
||||
/** Загружает справочник тегов; tag.name используется как отображаемое имя. */
|
||||
export function getTags(params: { edge?: string; search?: string } = {}): Promise<TagResponse> {
|
||||
return getJson<TagResponse>(cloudApiUrl, '/tag', params);
|
||||
}
|
||||
15
src/entities/tag/types.ts
Normal file
15
src/entities/tag/types.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export type TagItem = {
|
||||
id: string;
|
||||
name: string;
|
||||
tagGroup: string | null;
|
||||
min: number;
|
||||
max: number;
|
||||
comment: string;
|
||||
unitOfMeasurement: string;
|
||||
edgeIds: string[];
|
||||
precision: number | null;
|
||||
};
|
||||
|
||||
export type TagResponse = {
|
||||
items: TagItem[];
|
||||
};
|
||||
Reference in New Issue
Block a user