From 43e69021d45ae4077e126f308f863ec99b4c7940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Fri, 20 Aug 2021 13:49:21 +0500 Subject: [PATCH] update api client --- src/services/api/models/FileInfoDto.ts | 1 + src/services/api/services/FileService.ts | 21 +++++++++++++++++++ .../api/services/WellOperationService.ts | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/services/api/models/FileInfoDto.ts b/src/services/api/models/FileInfoDto.ts index 42d0df3..8f5309d 100644 --- a/src/services/api/models/FileInfoDto.ts +++ b/src/services/api/models/FileInfoDto.ts @@ -8,4 +8,5 @@ export type FileInfoDto = { idCategory?: number; uploadDate?: string; authorName?: string | null; + companyId?: number; } \ No newline at end of file diff --git a/src/services/api/services/FileService.ts b/src/services/api/services/FileService.ts index f532889..755d9c7 100644 --- a/src/services/api/services/FileService.ts +++ b/src/services/api/services/FileService.ts @@ -38,6 +38,7 @@ requestBody?: any, * @param idCategory id категории файла * @param begin дата начала * @param end дата окончания + * @param companies id компаний для фильтрации возвращаемых файлов * @returns FileInfoDtoPaginationContainer Success * @throws ApiError */ @@ -48,6 +49,7 @@ take: number = 32, idCategory: number, begin?: string, end?: string, +companies?: Array, ): Promise { const result = await __request({ method: 'GET', @@ -58,6 +60,7 @@ end?: string, 'idCategory': idCategory, 'begin': begin, 'end': end, + 'companies': companies, }, }); return result.body; @@ -81,4 +84,22 @@ fileId: number, return result.body; } + /** + * Удаляет файл с диска на сервере + * @param idWell id скважины + * @param idFile id запрашиваемого файла + * @returns number Success + * @throws ApiError + */ + public static async delete( +idWell: number, +idFile: number, +): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/well/${idWell}/files/${idFile}`, + }); + return result.body; + } + } \ No newline at end of file diff --git a/src/services/api/services/WellOperationService.ts b/src/services/api/services/WellOperationService.ts index 09d7004..cf209d2 100644 --- a/src/services/api/services/WellOperationService.ts +++ b/src/services/api/services/WellOperationService.ts @@ -44,7 +44,7 @@ sectionTypeIds?: Array, operationCategoryIds?: Array, begin?: string, end?: string, -skip: number = 0, +skip: number, take: number = 32, ): Promise { const result = await __request({