tdmswaroo / HelpDesk

Simuliranje spremljanja razvoja programske opreme centra za pomoč uporabnikom
GNU General Public License v3.0
0 stars 0 forks source link

Naredi da se seznam ticketov razporedi po datumih (navzgor, navzdol) #4

Closed rebra7 closed 7 years ago

rebra7 commented 7 years ago

Predpogoji

PHP 7.0.18 SQL 2.4

Koraki za reproduciranje težave

  1. Odpremo seznam ticketov.html
  2. Dodamo programsko kodo za sortiranje po datumu
  3. Dodamo gumbe za sortiranje nad ticketi
  4. Pri programski kodi spremenimo v kodi sledečo vrstico: GET /api/ticket_number?sort=-created_at,updated_at

Pričakovani rezultati

Koda: created_at asc created_at desc updated_at asc updated_at desc ticket number pravilno soritra tickete

Dejanski rezultat

  1. Napaka pri sortiranju Request: GET /api/ticket number?sort=-created_at,updated_at (exit) an exception was raised: (Postgrex.Error) unable to encode value [desc: "created_at", asc: "updated_at"] as type text (ecto) lib/ecto/adapters/postgres/worker.ex:18: Ecto.Adapters.Postgres.Worker.query!/4 (ecto) lib/ecto/adapters/postgres.ex:270: Ecto.Adapters.Postgres.use_worker/3 (stdlib) timer.erl:165: :timer.tc/1 (comet_api) lib/repo.ex:2: Repo.log/2 (ecto) lib/ecto/adapters/postgres.ex:64: Ecto.Adapters.Postgres.all/4 (ecto) lib/ecto/repo/queryable.ex:20: Ecto.Repo.Queryable.all/4 (comet_api) web/controllers/user_controller.ex:14: CometApi.UserController.index/2 (comet_api) web/controllers/user_controller.ex:1: CometApi.UserController.phoenix_controller_pipeline/2
rebra7 commented 7 years ago

Zadeva je uspešno rešena in lahko sortiramo po datumih :)