/
afanasevn
/
MaxSystems
Обзор
Документация
Войти
/
afanasevn
/
MaxSystems
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
client/src/api/maintenance.ts
31 строка
910 B
IBS\NAfanasev
Add project files.
18 июн 2026, 01:12
18 июн 2026, 01:12
b06aa39
Код
Авторство
О чём код?
import { apiGet, apiPost } from './http' import type { EquipmentSystem, WorkListItem } from './works' export type MaintenanceEquipmentSchedule = { id: string name: string system: EquipmentSystem location: string regulationName: string | null lastMaintenance: string | null nextMaintenance: string | null hasOpenWork: boolean openWorkId: string | null } export type MaintenanceOverview = { overdueCount: number upcomingCount: number openWorksCount: number overdueEquipment: MaintenanceEquipmentSchedule[] upcomingEquipment: MaintenanceEquipmentSchedule[] openWorks: WorkListItem[] } export async function fetchMaintenanceOverview(): Promise<MaintenanceOverview> { return apiGet<MaintenanceOverview>('/api/maintenance') } export async function generateMaintenanceWorks(): Promise<{ created: number }> { return apiPost<{ created: number }>('/api/maintenance/generate', {}) }