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
todo = db.execute("SELECT * FROM Todos WHERE id = ?", tid).first
if( todo["user_id"] == session[:id] ) then
slim :"todos/edit", locals: {todo: todo}
else
"401, access denied!"
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

Binary file not shown.
Loading…
Cancel
Save