diff --git a/lib/workload_service_web/controllers/task_controller.ex b/lib/workload_service_web/controllers/task_controller.ex index 5d97227..77b48cb 100644 --- a/lib/workload_service_web/controllers/task_controller.ex +++ b/lib/workload_service_web/controllers/task_controller.ex @@ -104,7 +104,7 @@ defmodule WorkloadServiceWeb.TaskController do "recorded_by" => "system", "document_data" => params["document_data"] }, - attachments: List.wrap(params["document_url"]) + attachments: params["document_urls"] || [] } dispatch_and_respond(conn, id, command) @@ -130,7 +130,7 @@ defmodule WorkloadServiceWeb.TaskController do "expiry_date" => params["expiry_date"], "recorded_by" => "system" }, - attachments: [] + attachments: params["document_urls"] || [] } dispatch_and_respond(conn, id, command) diff --git a/lib/workload_service_web/schemas/task.ex b/lib/workload_service_web/schemas/task.ex index 97c07ac..1f804a0 100644 --- a/lib/workload_service_web/schemas/task.ex +++ b/lib/workload_service_web/schemas/task.ex @@ -79,7 +79,7 @@ defmodule WorkloadServiceWeb.Schemas.Task do valid_until: %Schema{type: :string, format: :date}, plans: %Schema{type: :array, items: Plan, minItems: 1}, document_data: %Schema{type: :object, additionalProperties: true, nullable: true}, - document_url: %Schema{type: :string, nullable: true} + document_urls: %Schema{type: :array, items: %Schema{type: :string}, nullable: true} } }) end @@ -112,7 +112,7 @@ defmodule WorkloadServiceWeb.Schemas.Task do valid_until: %Schema{type: :string, format: :date}, plans: %Schema{type: :array, items: Plan, minItems: 1}, document_data: %Schema{type: :object, additionalProperties: true, nullable: true}, - document_url: %Schema{type: :string, nullable: true} + document_urls: %Schema{type: :array, items: %Schema{type: :string}, nullable: true} } }) end