wired up vote ux
This commit is contained in:
@ -7,9 +7,10 @@ module Admin
|
||||
current_user.cast_yea_on(@candidate)
|
||||
|
||||
results = {
|
||||
message: "Vote tallied!",
|
||||
message: "Vote Counted",
|
||||
upCount: @candidate.votes.yea.count,
|
||||
downCount: @candidate.votes.nay.count
|
||||
downCount: @candidate.votes.nay.count,
|
||||
myVote: "yea"
|
||||
}
|
||||
render json: results.to_json
|
||||
end
|
||||
@ -20,9 +21,10 @@ module Admin
|
||||
current_user.cast_nay_on(@candidate)
|
||||
|
||||
results = {
|
||||
message: "Vote tallied!",
|
||||
message: "Vote Counted",
|
||||
upCount: @candidate.votes.yea.count,
|
||||
downCount: @candidate.votes.nay.count
|
||||
downCount: @candidate.votes.nay.count,
|
||||
myVote: "nay"
|
||||
}
|
||||
render json: results.to_json
|
||||
end
|
||||
@ -32,7 +34,11 @@ module Admin
|
||||
@candidate = Candidate.find_by(test_hash: params[:test_hash])
|
||||
current_user.approve_candidate(@candidate)
|
||||
|
||||
results = { message: "Interview requested!" }
|
||||
results = {
|
||||
message: "Interview requested!",
|
||||
requestCopy: "Requested",
|
||||
declineCopy: "Decline Interview"
|
||||
}
|
||||
render json: results.to_json
|
||||
end
|
||||
|
||||
@ -41,7 +47,11 @@ module Admin
|
||||
@candidate = Candidate.find_by(test_hash: params[:test_hash])
|
||||
current_user.decline_candidate(@candidate)
|
||||
|
||||
results = { message: "Interview declined." }
|
||||
results = {
|
||||
message: "Interview declined.",
|
||||
requestCopy: "Request Interview",
|
||||
declineCopy: "Declined"
|
||||
}
|
||||
render json: results.to_json
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user