Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.25 KB | None | 0 0
  1. get("/todos", _Req, State) ->
  2.    Query = fun() ->
  3.       qlc:e(
  4.          qlc:q([X || X <- mnesia:table(todo)])
  5.       )
  6.    end,
  7.    {atomic, Records} = mnesia:transaction(Query),
  8.    Json = todo_helper:format(Records),
  9.    {200, {json, Json}, State};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement