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

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

Binary file not shown.
Loading…
Cancel
Save