mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat: getting presigned url of the uploaded attachment
This commit is contained in:
@@ -5,6 +5,7 @@ import { GetAttachment } from './GetAttachment';
|
||||
import { AttachmentUploadPipeline } from './S3UploadPipeline';
|
||||
import { LinkAttachment } from './LinkAttachment';
|
||||
import { UnlinkAttachment } from './UnlinkAttachment';
|
||||
import { getAttachmentPresignedUrl } from './GetAttachmentPresignedUrl';
|
||||
|
||||
@Service()
|
||||
export class AttachmentsApplication {
|
||||
@@ -26,6 +27,9 @@ export class AttachmentsApplication {
|
||||
@Inject()
|
||||
private unlinkDocumentService: UnlinkAttachment;
|
||||
|
||||
@Inject()
|
||||
private getPresignedUrlService: getAttachmentPresignedUrl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns
|
||||
@@ -101,4 +105,13 @@ export class AttachmentsApplication {
|
||||
modelId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the presigned url of the given attachment key.
|
||||
* @param {string} key
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
public getPresignedUrl(key: string): Promise<string> {
|
||||
return this.getPresignedUrlService.getPresignedUrl(key);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user