aboutsummaryrefslogtreecommitdiff
path: root/web/controllers
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2017-02-09 14:25:20 +0100
committerneodarz <neodarz@neodarz.net>2017-02-09 14:25:20 +0100
commitb6ee08c2fb5ba808fe152af973b529840097113e (patch)
tree2d3b411656be6478ef2921b8470f5dae26e7f1e1 /web/controllers
parent1f3c2338b7e5d4b3bd2a980d7c909ff0bf968d5f (diff)
downloadthe_transcriber_backend-b6ee08c2fb5ba808fe152af973b529840097113e.tar.xz
the_transcriber_backend-b6ee08c2fb5ba808fe152af973b529840097113e.zip
Fix a little bug to set the correct id when the file it's uploaded
Diffstat (limited to '')
-rw-r--r--web/controllers/audio_file_controller.ex2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/controllers/audio_file_controller.ex b/web/controllers/audio_file_controller.ex
index ef9d46c..c4e1af0 100644
--- a/web/controllers/audio_file_controller.ex
+++ b/web/controllers/audio_file_controller.ex
@@ -19,7 +19,7 @@ defmodule TheTranscriberBackend.AudioFileController do
result = Ecto.Adapters.SQL.query!(Repo, query, [])
[[repo_last_id]] = result.rows # A beautiful pattern match :)
- path = "/media/phoenix_test/#{repo_last_id}_#{upload.filename}"
+ path = "/media/phoenix_test/#{repo_last_id + 1}_#{upload.filename}"
File.cp(upload.path, path)
changeset = AudioFile.changeset(%AudioFile{},