diff options
author | neodarz <neodarz@neodarz.net> | 2017-03-07 11:54:54 +0100 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2017-03-07 11:54:54 +0100 |
commit | 33ab470b39edfe2caa12dd55b8a307ce6ededb34 (patch) | |
tree | 05e0224f05f80c05ac062d634b9989750c405c1d | |
parent | 2d7d92be4046f0eef03b8d7f4b5f851f4bc10ff0 (diff) | |
download | the_transcriber_backend-33ab470b39edfe2caa12dd55b8a307ce6ededb34.tar.xz the_transcriber_backend-33ab470b39edfe2caa12dd55b8a307ce6ededb34.zip |
Fix upload file internal error
Diffstat (limited to '')
-rw-r--r-- | test/models/audio_file_api_test.exs | 7 | ||||
-rw-r--r-- | web/models/audio_file_api.ex | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/test/models/audio_file_api_test.exs b/test/models/audio_file_api_test.exs index 028befa..2e15a2e 100644 --- a/test/models/audio_file_api_test.exs +++ b/test/models/audio_file_api_test.exs @@ -3,7 +3,12 @@ defmodule TheTranscriberBackend.AudioFileAPITest do alias TheTranscriberBackend.AudioFileAPI - @valid_attrs %{} + @valid_attrs %{ + audio_path: "myfile.mp3", + audio_name: "MyFile", + audio_duration: "00:00" + + } @invalid_attrs %{} test "changeset with valid attributes" do diff --git a/web/models/audio_file_api.ex b/web/models/audio_file_api.ex index 802d179..a66cdc4 100644 --- a/web/models/audio_file_api.ex +++ b/web/models/audio_file_api.ex @@ -17,7 +17,7 @@ defmodule TheTranscriberBackend.AudioFileAPI do """ def changeset(struct, params \\ %{}) do struct - |> cast(params, []) - |> validate_required([]) + |> cast(params, [:audio_path, :audio_name, :audio_duration]) + |> validate_required([:audio_path, :audio_name, :audio_duration]) end end |