Added status attribute to videos; added ability to edit video status and serial independently
This commit is contained in:
@ -99,6 +99,17 @@ namespace '/video' do
|
||||
redirect "/video/#{video.id}"
|
||||
end
|
||||
|
||||
post '/:video_id/edit/:attr' do
|
||||
# find video and temporarily save the old video path
|
||||
video = Video.where(id: params[:video_id]).first()
|
||||
attrToEdit = params[:attr]
|
||||
|
||||
video[attrToEdit.to_sym] = params[attrToEdit]
|
||||
video.save()
|
||||
|
||||
return "success"
|
||||
end
|
||||
|
||||
get '/:video_id/delete' do
|
||||
# find the video and delete it
|
||||
video = Video.where(id: params[:video_id]).first()
|
||||
|
Reference in New Issue
Block a user