1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-11 17:42:48 +00:00

server - repo associations figured out with thread/reply/user

This commit is contained in:
2018-01-08 22:39:38 -06:00
parent 43615213d8
commit e63514ff45
7 changed files with 105 additions and 19 deletions

View File

@@ -30,15 +30,15 @@ defmodule MyApp.Data.Reply do
|> validate_required([:content])
end
@spec insert_reply(map) :: {:ok, map} | {:error, map}
def insert_reply(params) do
@spec insert(map) :: {:ok, map} | {:error, map}
def insert(params) do
insert_changeset(%Data.Reply{}, params)
|> Repo.insert
|> Data.Util.process_insert_or_update
end
@spec user_update_reply(map) :: {:ok, map} | {:error, map}
def user_update_reply(params) do
@spec user_update(map) :: {:ok, map} | {:error, map}
def user_update(params) do
id = Map.get(params, "id")
user_id = Map.get(params, "user_id")