From 763ea5331b1977dd949c776215f2c7719f81ee9a Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Wed, 20 Apr 2022 16:03:17 -0600 Subject: Initial chat box; man phoenix does not have the best docs --- lib/aggiedit/rooms/comment.ex | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/aggiedit/rooms') diff --git a/lib/aggiedit/rooms/comment.ex b/lib/aggiedit/rooms/comment.ex index 6747ba3..01f411a 100644 --- a/lib/aggiedit/rooms/comment.ex +++ b/lib/aggiedit/rooms/comment.ex @@ -17,4 +17,8 @@ defmodule Aggiedit.Post.Comment do |> cast(attrs, [:comment]) |> validate_required([:comment]) end + + def serialize(c) do + %{"body" => c.comment, "user" => c.user.username, "id" => c.id, "inserted_at" => c.inserted_at} + end end -- cgit v1.2.3-70-g09d2