updates list rest api

- list no longer returns a json array
  but a json object, which contains a
  "messages" json array instead
This commit is contained in:
2021-12-17 16:23:48 +01:00
parent 5d50bb30e6
commit 8262b61085
7 changed files with 14 additions and 14 deletions

View File

@ -16,12 +16,12 @@ defmodule Bump.Messages do
Repo.delete_all(from m in "messages", where: m.id == ^res.id)
%{data: res.data, timestamp: res.timestamp}
else
nil
%{}
end
end
def peak(sender) do
def peek(sender) do
query = from m in "messages",
where: m.sender == ^sender,
order_by: [desc: m.timestamp],