mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-11 09:32:51 +00:00
server - fix tests - added reply tests
This commit is contained in:
@@ -38,7 +38,7 @@ defmodule MyApp.Data.Reply do
|
||||
{:ok, data} = Repo.transaction(fn ->
|
||||
thread = Repo.get_by(Data.Thread, %{ id: Map.get(params, "thread_id")})
|
||||
|
||||
if !thread.locked do
|
||||
if !is_nil(thread) && !thread.locked do
|
||||
{:ok, data} = insert_changeset(%Data.Reply{}, params)
|
||||
|> Repo.insert
|
||||
|> Data.Util.process_insert_or_update
|
||||
|
||||
@@ -7,7 +7,7 @@ defmodule MyAppWeb.PageController do
|
||||
|
||||
# cache index.html if prod
|
||||
file = case System.get_env("MIX_ENV") do
|
||||
:prod ->
|
||||
"prod" ->
|
||||
Cachex.get(:myapp, "index.html")
|
||||
|> get_file
|
||||
_ -> File.read!(Application.app_dir(:myapp, "priv/static/index.html"))
|
||||
|
||||
Reference in New Issue
Block a user