Skip to content

Commit

Permalink
AE-2247: Fix retrieval of viestiketjut
Browse files Browse the repository at this point in the history
  • Loading branch information
solita-juhohaa committed Oct 16, 2024
1 parent 03b8b80 commit d25bf27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
(mapv (partial check-oikeellisuuden-valvonta-viestiketjut db) vo-toimenpide-ids)))

(defn- destroy-energiatodistus-viestiketjut [db aws-s3-client energiatodistus-id]
(let [viestiketjut-ids (map :id (energiatodistus-destruction-db/select-vo-toimenpiteet-by-energiatodistus-id db {:energiatodistus_id energiatodistus-id}))]
(mapv #(destroy-viestiketju db aws-s3-client %) viestiketjut-ids)
(let [viestiketjut-ids (map :viestiketju-id (energiatodistus-destruction-db/select-viestiketjut-by-energiatodistus-id db {:energiatodistus_id energiatodistus-id}))]
(mapv #(destroy-viestiketju db aws-s3-client %) viestiketjut-ids)
(check-oikeellisuuden-valvontojen-viestiketjut db energiatodistus-id)))

(defn- destroy-expired-energiatodistus! [db aws-s3-client energiatodistus-id]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ delete
from viesti
where id = :viesti_id;

-- name: select-viestiketjut-by-energiatodistus
-- name: select-viestiketjut-by-energiatodistus-id
select id as viestiketju_id
from viestiketju
where energiatodistus_id = :energiatodistus_id;
Expand Down

0 comments on commit d25bf27

Please sign in to comment.