Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- get("/todos", _Req, State) ->
- Query = fun() ->
- qlc:e(
- qlc:q([X || X <- mnesia:table(todo)])
- )
- end,
- {atomic, Records} = mnesia:transaction(Query),
- Json = todo_helper:format(Records),
- {200, {json, Json}, State};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement