class VotesController < ApplicationController
  before_action :authenticate_user!

  def create
    vote = Vote.new
    vote.user = current_user
    vote.meme_id = params[:meme_id]

    if vote.save
      head :no_content
    else
      render json: { message: 'Validation failed', errors: vote.errors }, status: 400
    end
  end
end
