Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET/ PATCH/ DELETE/ for stickers #184

Closed
wants to merge 13 commits into from
Closed

GET/ PATCH/ DELETE/ for stickers #184

wants to merge 13 commits into from

Conversation

pzhang24
Copy link
Contributor

🎟️ Ticket(s):
Closes #135, #136, #137

👷 Changes:

  • Added the following handler functions to stickers: stickerGet, stickerUpdate, stickerDelete
  • Created unit tests for the above functions
  • Created integration test for stickers

💭 Notes:
Any additional things to take into consideration.

Wait! Before you merge, have you checked the following:

  • Serverless tests are passing (Check travis build logs, CI is currently broken)
  • PR is has approving review(s)

@pzhang24 pzhang24 requested review from Resocram, dchen150 and huangsamantha and removed request for Resocram and dchen150 March 17, 2021 07:03
services/stickers/test/stickerUpdate.js Outdated Show resolved Hide resolved
services/stickers/handler.js Outdated Show resolved Hide resolved
path:
id: true
cors: true
authorizer:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want this one public

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove everything under authorizer? Do any of the other services do this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, here's an example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to be clear, do we want stickerGet to be public, or do we want stickerCreate to be public (like registrationPost is), or both? I'm going to try and wrap this ticket up.

expect(response.statusCode).to.be.equal(200);

});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After we implement the s3 functions, we will need the tests to confirm that the appropriate functions were run (e.g. we would want the sticker delete function to run the s3 delete function, and check that the correct url was deleted)

}

let imageData = body.image;
if (body.image.substr(0, 7) === 'base64,') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this just to check if the image is encoded in base64? is this a reliable way to check that? And what would happen if its a different encoding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This If statement just cleans up the input if the string starts with 'base64,'. Also, I think we're just going to make the assumption that the image needs to be encoded in base64 when it is uploaded and transmitted.

services/stickers/handler.js Outdated Show resolved Hide resolved
services/stickers/handler.js Outdated Show resolved Hide resolved
services/stickers/serverless.yml Outdated Show resolved Hide resolved
@huangsamantha
Copy link
Contributor

huangsamantha commented Mar 26, 2021

TODO:

  • generate id (uuid) to ensure uniqueness
  • dynamically choose bucket (between staging and prod)
  • get from s3
  • delete from s3
  • update s3
  • remove console logs lol
  • tests
  • permissions - users should not be able to update key

@pzhang24 pzhang24 requested review from huangsamantha and Resocram and removed request for huangsamantha and Resocram July 21, 2021 04:20
@voctory
Copy link
Member

voctory commented Sep 26, 2024

Closing stale PRs in ubc-biztech org

@voctory voctory closed this Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GET /stickers/:id
4 participants