aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2017-03-10 12:03:32 +0100
committerneodarz <neodarz@neodarz.net>2017-03-10 12:03:32 +0100
commit220c151c4b5ea20a24944bde2ec62bbe947fb6a5 (patch)
treefc4ec5bf0212a966c9c277897abc358d8b79e526 /web
parentdd8662ed25467fe06ca8132a998b8d1409b0af65 (diff)
downloadthe_transcriber_backend-220c151c4b5ea20a24944bde2ec62bbe947fb6a5.tar.xz
the_transcriber_backend-220c151c4b5ea20a24944bde2ec62bbe947fb6a5.zip
add fictive shell commandHEADv1.0master
Diffstat (limited to 'web')
-rw-r--r--web/controllers/audio_file_controller.ex4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/controllers/audio_file_controller.ex b/web/controllers/audio_file_controller.ex
index 784c92c..ff78e14 100644
--- a/web/controllers/audio_file_controller.ex
+++ b/web/controllers/audio_file_controller.ex
@@ -24,6 +24,7 @@ defmodule TheTranscriberBackend.AudioFileController do
case Repo.insert(changeset) do
{:ok, audio_file} ->
File.cp(upload.path, "#{path}#{audio_file.id}_#{upload.filename}")
+ System.cmd "notify-send", ["Yeah ! Your file is uploaded !"]
conn
|> put_status(:created)
|> put_resp_header("location", audio_file_path(conn, :show, audio_file))
@@ -79,7 +80,8 @@ defmodule TheTranscriberBackend.AudioFileController do
def delete(conn, %{"id" => id}) do
path = "/media/phoenix_test/"
- audio_file = Repo.get!(AudioFile, id)
+ audio_file = Repo.get(AudioFile, id)
+ quey = from the_audio_file in AudioFile, where: [id: ^id]
cond do
audio_file !=nil ->
# Here we use delete! (with a bang) because we expect