-
Notifications
You must be signed in to change notification settings - Fork 1
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
Contributor edit endpoint #11
base: contributor-show-endpoint
Are you sure you want to change the base?
Conversation
def render_error(status, message) | ||
render json: message, status: status | ||
end |
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.
You are not using this method, we could delete it
|
||
def update | ||
contributor = Contributor.find(params[:id]) | ||
return render json: contributor, status: :ok if contributor.update(update_params) |
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.
I think that the status: :ok
bit is not needed, maybe you can check which response code gives if you delete that?
app/policies/contributor_policy.rb
Outdated
class ContributorPolicy < ApplicationPolicy | ||
attr_reader :user, :contributor | ||
|
||
def initialize(user, post) |
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.
It seems that this class is not needed, provided that we don't have a Post model in this project.
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.
Great work! 💯
Summary
Contributor update endpoint
with tests
login will be done after along with pundiit
Screenshots
[Change!] Show the screenshots of the views you modified.
Trello Card