Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
chuck-dbos committed Oct 17, 2023
1 parent a769294 commit 0ab7789
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions yky-social/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class YKY
@OperonWorkflow()
static async doKeyUpload(ctx: WorkflowContext, filename: string) {
const key = `photos/${filename}-${Date.now()}`;
const bucket = ctx.getConfig('S3_BUCKET_NAME') || 'yky-social-photos';
const bucket = ctx.getConfig('S3_BUCKET_NAME') as string || 'yky-social-photos';
const postPresigned = await ctx.invoke(Operations).createS3UploadKey(key, bucket);

return {message: "Signed URL", url: postPresigned.url, key: key, fields: postPresigned.fields};
Expand All @@ -221,7 +221,7 @@ export class YKY
@GetApi("/getMediaDownloadKey")
static async doKeyDownload(ctx: HandlerContext, filekey: string) {
const key = filekey;
const bucket = ctx.getConfig('S3_BUCKET_NAME') || 'yky-social-photos';
const bucket = ctx.getConfig('S3_BUCKET_NAME') as string || 'yky-social-photos';

const presignedUrl = await Operations.getS3DownloadKey(ctx, key, bucket);
return { message: "Signed URL", url: presignedUrl, key: key };
Expand All @@ -230,7 +230,7 @@ export class YKY
@GetApi("/deleteMedia")
static async doMediaDelete(ctx: HandlerContext, filekey: string) {
const key = filekey;
const bucket = ctx.getConfig('S3_BUCKET_NAME') || 'yky-social-photos';
const bucket = ctx.getConfig('S3_BUCKET_NAME') as string || 'yky-social-photos';

// TODO: Validate user and drop from table

Expand All @@ -241,7 +241,7 @@ export class YKY
@GetApi("/startMediaUpload")
static async doStartMediaUpload(ctx: HandlerContext) {
const mediaKey = uuidv4();
const bucket = ctx.getConfig('S3_BUCKET_NAME') || 'yky-social-photos';
const bucket = ctx.getConfig('S3_BUCKET_NAME') as string || 'yky-social-photos';

// Future: Rate limit the user's requests as they start workflows...
// Or give the user the existing workflow, if any
Expand Down Expand Up @@ -275,7 +275,7 @@ export class YKY
const filekey = await ctx.invoke(Operations).getMyProfilePhotoKey(ctx.authenticatedUser);
if (filekey === null) return {};

const bucket = ctx.getConfig('S3_BUCKET_NAME') || 'yky-social-photos';
const bucket = ctx.getConfig('S3_BUCKET_NAME') as string || 'yky-social-photos';

const presignedUrl = await Operations.getS3DownloadKey(ctx, filekey, bucket);
ctx.logger.debug("Giving URL "+presignedUrl);
Expand Down

0 comments on commit 0ab7789

Please sign in to comment.