Skip to content

Commit

Permalink
Merge pull request #88 from Samagra-Anamaya/minio-setup
Browse files Browse the repository at this point in the history
chore: get media link endpoint added
  • Loading branch information
geeky-abhishek authored Oct 17, 2023
2 parents c6154aa + d9c81a7 commit a1db15f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/bff/src/upload/upload.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
BadRequestException,
Controller,
Get,
Param,
Post,
UploadedFile,
UploadedFiles,
Expand Down Expand Up @@ -60,4 +61,11 @@ export class UploadController {
throw error;
}
}

@Get(':filename')
async getSubmissionByVillageId(
@Param('filename') filename: string,
): Promise<any> {
return await this.uploadService.getMediaUrl(filename);
}
}
7 changes: 7 additions & 0 deletions packages/bff/src/upload/upload.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ export class UploadService {
throw error;
}
}

async getMediaUrl(filename: string) {
return await this.minioService.getFileLink(
this.configService.get<string>('MINIO_BUCKET'),
filename,
);
}
}

0 comments on commit a1db15f

Please sign in to comment.