From 9e89c7ab66691fb2b65b51ee327c23264130a72c Mon Sep 17 00:00:00 2001 From: Cadu Gomes Date: Mon, 18 Nov 2024 16:19:52 -0300 Subject: [PATCH] fix: use record code on upload url --- src/sdk/FilesManager.ts | 8 ++++---- src/sdk/types/files.ts | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sdk/FilesManager.ts b/src/sdk/FilesManager.ts index 56e193f..f154c58 100644 --- a/src/sdk/FilesManager.ts +++ b/src/sdk/FilesManager.ts @@ -7,10 +7,10 @@ import NodeFormData from 'form-data'; import verifyResponseStatus from '../utils/verifyResponseStatus'; const endpoints = { - upload: ({ metaObject, recordId, fieldName }: KonFiles.RecordData) => - `rest/file/upload/ns/access/${metaObject}/${recordId}/${fieldName}`, - delete: ({ metaObject, recordId, fieldName }: KonFiles.RecordData, fileName: string) => - `rest/file/delete/ns/access/${metaObject}/${recordId}/${fieldName}/${fileName}`, + upload: ({ metaObject, recordCode, fieldName }: KonFiles.RecordData) => + `rest/file/upload/ns/access/${metaObject}/${recordCode}/${fieldName}`, + delete: ({ metaObject, recordCode, fieldName }: KonFiles.RecordData, fileName: string) => + `rest/file/delete/ns/access/${metaObject}/${recordCode}/${fieldName}/${fileName}`, }; export class FilesManager { diff --git a/src/sdk/types/files.ts b/src/sdk/types/files.ts index 0b0d4e3..60eb262 100644 --- a/src/sdk/types/files.ts +++ b/src/sdk/types/files.ts @@ -13,6 +13,7 @@ export namespace KonFiles { metaObject: string; fieldName: string; recordId: string; + recordCode: string; _updatedAt?: string | Date; };