allow array of documents in task
All checks were successful
Build and Publish / build-release (push) Successful in 1m31s

This commit is contained in:
2026-04-24 12:11:19 -05:00
parent cc5fb578d3
commit 7feef642ca
2 changed files with 4 additions and 4 deletions

View File

@@ -104,7 +104,7 @@ defmodule WorkloadServiceWeb.TaskController do
"recorded_by" => "system", "recorded_by" => "system",
"document_data" => params["document_data"] "document_data" => params["document_data"]
}, },
attachments: List.wrap(params["document_url"]) attachments: params["document_urls"] || []
} }
dispatch_and_respond(conn, id, command) dispatch_and_respond(conn, id, command)
@@ -130,7 +130,7 @@ defmodule WorkloadServiceWeb.TaskController do
"expiry_date" => params["expiry_date"], "expiry_date" => params["expiry_date"],
"recorded_by" => "system" "recorded_by" => "system"
}, },
attachments: [] attachments: params["document_urls"] || []
} }
dispatch_and_respond(conn, id, command) dispatch_and_respond(conn, id, command)

View File

@@ -79,7 +79,7 @@ defmodule WorkloadServiceWeb.Schemas.Task do
valid_until: %Schema{type: :string, format: :date}, valid_until: %Schema{type: :string, format: :date},
plans: %Schema{type: :array, items: Plan, minItems: 1}, plans: %Schema{type: :array, items: Plan, minItems: 1},
document_data: %Schema{type: :object, additionalProperties: true, nullable: true}, 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 end
@@ -112,7 +112,7 @@ defmodule WorkloadServiceWeb.Schemas.Task do
valid_until: %Schema{type: :string, format: :date}, valid_until: %Schema{type: :string, format: :date},
plans: %Schema{type: :array, items: Plan, minItems: 1}, plans: %Schema{type: :array, items: Plan, minItems: 1},
document_data: %Schema{type: :object, additionalProperties: true, nullable: true}, 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 end