master
E. Almqvist 3 years ago
parent 1322f5f1ba
commit 058eb0d702
  1. 12
      wesweb01/todo2021/app.rb
  2. BIN
      wesweb01/todo2021/db/todo.db

@ -46,10 +46,14 @@ get "/todos/:tid/edit" do
db.results_as_hash = true db.results_as_hash = true
todo = db.execute("SELECT * FROM Todos WHERE id = ?", tid).first todo = db.execute("SELECT * FROM Todos WHERE id = ?", tid).first
if( todo["user_id"] == session[:id] ) then begin
slim :"todos/edit", locals: {todo: todo} if( todo["user_id"] == session[:id] ) then
else slim :"todos/edit", locals: {todo: todo}
"401, access denied!" else
"401, access denied!"
end
rescue => err
"500, TODO not found."
end end
end end

Binary file not shown.
Loading…
Cancel
Save