From 220c151c4b5ea20a24944bde2ec62bbe947fb6a5 Mon Sep 17 00:00:00 2001 From: neodarz Date: Fri, 10 Mar 2017 12:03:32 +0100 Subject: add fictive shell command --- web/controllers/audio_file_controller.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web') 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 -- cgit v1.2.1