2015-01-04 17:40:02 -07:00
|
|
|
module Api
|
|
|
|
class SequencesController < Api::AbstractController
|
|
|
|
def create
|
2015-01-06 06:14:53 -07:00
|
|
|
mutate Sequences::Create.run(params, user: current_user)
|
2015-01-04 17:40:02 -07:00
|
|
|
end
|
2015-01-14 05:53:12 -07:00
|
|
|
|
|
|
|
def destroy
|
|
|
|
# TODO: If you touch this again, add a mutation.
|
|
|
|
seq = Sequence.find(params[:id])
|
|
|
|
if (seq.user == current_user) && seq.destroy
|
|
|
|
render nothing: true
|
|
|
|
else
|
|
|
|
raise Errors::Forbidden, "Not your Sequence object."
|
|
|
|
end
|
|
|
|
end
|
2015-01-04 17:40:02 -07:00
|
|
|
end
|
|
|
|
end
|