Added status attribute to videos; added ability to edit video status and serial independently

This commit is contained in:
2023-03-06 17:59:58 -05:00
parent f243452783
commit 4735047682
5 changed files with 63 additions and 0 deletions

View File

@ -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()