diff --git a/lib/localiser/web/controllers/tag_controller.ex b/lib/localiser/web/controllers/tag_controller.ex index 4070620..65040b1 100644 --- a/lib/localiser/web/controllers/tag_controller.ex +++ b/lib/localiser/web/controllers/tag_controller.ex @@ -136,6 +136,7 @@ defmodule Localiser.Web.Controllers.TagController do id: tag.id, tag_id: tag.tag_id, name: tag.name, + color: tag.color, room_id: live && live.room_id, last_seen: live && live.last_seen } diff --git a/lib/localiser/web/schemas.ex b/lib/localiser/web/schemas.ex index 2485889..5c8476c 100644 --- a/lib/localiser/web/schemas.ex +++ b/lib/localiser/web/schemas.ex @@ -70,10 +70,11 @@ defmodule Localiser.Web.Schemas do id: %Schema{type: :integer}, tag_id: %Schema{type: :string}, name: %Schema{type: :string}, + color: %Schema{type: :string, nullable: true}, room_id: %Schema{type: :integer, nullable: true}, last_seen: %Schema{type: :string, format: :"date-time", nullable: true} }, - required: [:id, :tag_id, :name, :room_id, :last_seen] + required: [:id, :tag_id, :name, :color, :room_id, :last_seen] }) end @@ -325,7 +326,8 @@ defmodule Localiser.Web.Schemas do title: "TagParams", type: :object, properties: %{ tag_id: %Schema{type: :string, description: "BLE MAC address or device ID"}, - name: %Schema{type: :string} + name: %Schema{type: :string}, + color: %Schema{type: :string} }, required: [:tag_id, :name] }) @@ -335,7 +337,10 @@ defmodule Localiser.Web.Schemas do require OpenApiSpex OpenApiSpex.schema(%{ title: "TagUpdateParams", type: :object, - properties: %{name: %Schema{type: :string}} + properties: %{ + name: %Schema{type: :string}, + color: %Schema{type: :string} + } }) end end