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
Add project preview image API #1477
Conversation
Code Climate has analyzed commit 33791f4 and detected 0 issues on this pull request. View more on Code Climate. |
@satu0king @tachyons please check!! |
Looks good to me! Thanks |
@@ -34,6 +34,11 @@ def show | |||
render json: Api::V1::ProjectSerializer.new(@project, @options) | |||
end | |||
|
|||
def image_preview | |||
@project = Project.open.find(params[:id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about private projects? They don't have preview images ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They do have but @satu0king asked me for public projects only, is that right @satu0king ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes idea is that we don't want private project's preview image to get leaked this way. @tachyons is there a better way or its fine to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@satu0king We can return 403 if the user is not authorized to view this project, right?
Describe the changes you have made in this PR -
Add
/api/v1/project/:id/image_preview
to GET public project's full image urlScreenshots of the changes (If any) -
Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.