feat(pastes): add REST routes to view and create pastes

Signed-off-by: Amogh Lele <amogh@dyte.io>
This commit is contained in:
Amogh Lele committed 2022-05-07 00:04:59 +05:30
1 parent bf50e4264d
commit 20a0b45954
4 files changed
+73

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
defmodule KetbinWeb.Api.PasteView do
use KetbinWeb, :view
def render("paste.json", %{paste: paste}) do
%{
id: paste.id,
content: paste.content,
is_url: paste.is_url
}
end
def render("error.json", _assigns) do
%{
success: false,
msg: "Something went wrong"
}
end
end