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

This commit is contained in:
gballan committed 2023-03-06 17:59:58 -05:00
1 parent f243452783
commit 4735047682
5 files changed
+63

No files matched your search

+11
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()