Skip to content

Commit

Permalink
Merge pull request #55 from konecty/fix/upload-url
Browse files Browse the repository at this point in the history
fix: use record code on upload url
  • Loading branch information
CaduGomes authored Nov 18, 2024
2 parents e501d26 + 9e89c7a commit bcd0a83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sdk/FilesManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/sdk/types/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export namespace KonFiles {
metaObject: string;
fieldName: string;
recordId: string;
recordCode: string;
_updatedAt?: string | Date;
};

Expand Down

0 comments on commit bcd0a83

Please sign in to comment.