Skip to content

[fix] - get arke return 500 after edit #46

@ErikFerrari

Description

@ErikFerrari

Requirements:

  • project: prova_progetto
  • endpoint get : {{base_path}}/test_arke/unit
  • endpoint put: {{base_path}}/arke/unit/test_arke
  • body put (change active status between true and false):
{
    "parameters": [],
    "type": "arke",
    "active": true,
    "label": "Test Arke",
    "updated_at": "2023-07-03T14:26:10.000000Z",
    "inserted_at": "2023-07-03T14:26:10.000000Z",
    "metadata": {
        "project": "arke_system"
    },
    "arke_id": "arke",
    "id": "test_arke"
}

Description:

i start the backend locally then i run the get endpoint and it returns 200 with 0 unit. Then i edit the same arke using the put and it also return 200, but if i run again the get it return 500 with the error message no function clause matching in ArkePostgres.Query.get_column/1 (nil is given to the get_column function)

below the arke in the query of the get:

Before edit

%Arke.Core.Unit{
  id: :test_arke,
  data: %{
    active: true,
    label: "Test Arke",
    parameters: [
      %{
        arke: :string,
        id: :id,
        metadata: [required: true, persistence: "table_column"]
      },
      %{
        arke: :string,
        id: :arke_id,
        metadata: [required: false, persistence: "table_column"]
      },
      %{
        arke: :dict,
        id: :metadata,
        metadata: [required: false, persistence: "table_column"]
      },
      %{
        arke: :datetime,
        id: :inserted_at,
        metadata: [required: false, persistence: "table_column"]
      },
      %{
        arke: :datetime,
        id: :updated_at,
        metadata: [required: false, persistence: "table_column"]
      }
    ],
    type: "arke"
  },
  arke_id: :arke,
  link: nil,
  metadata: %{:project => :prova_progetto, "project" => "arke_system"},
  inserted_at: ~U[2023-07-03 14:26:10.000000Z],
  updated_at: ~U[2023-07-03 14:26:10.000000Z],
  __module__: Arke.System.Arke
}

After edit

%Arke.Core.Unit{
  id: :test_arke,
  data: %{
    active: false,
    arke_id: "arke",
    label: "Test Arke",
    parameters: [],
    type: "arke"
  },
  arke_id: :arke,
  link: nil,
  metadata: %{:project => :prova_progetto, "project" => "arke_system"},
  inserted_at: ~U[2023-07-03 14:26:10.000000Z],
  updated_at: ~U[2023-07-03 14:26:10.000000Z],
  __module__: nil
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions