diff options
author | neodarz <neodarz@neodarz.net> | 2017-03-10 12:03:32 +0100 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2017-03-10 12:03:32 +0100 |
commit | 220c151c4b5ea20a24944bde2ec62bbe947fb6a5 (patch) | |
tree | fc4ec5bf0212a966c9c277897abc358d8b79e526 | |
parent | dd8662ed25467fe06ca8132a998b8d1409b0af65 (diff) | |
download | the_transcriber_backend-master.tar.xz the_transcriber_backend-master.zip |
Diffstat (limited to '')
-rw-r--r-- | web/controllers/audio_file_controller.ex | 4 |
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 |