Fix pinned versions showing deleted versions

This commit is contained in:
Nassim Jahnke 2022-07-18 14:10:51 +02:00
parent a320eaad37
commit a803c85984
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -118,7 +118,7 @@ public interface HangarVersionsDAO {
FROM pinned_versions pv
JOIN project_versions p ON pv.version_id = p.id
JOIN project_channels pc on pc.id = p.channel_id
WHERE pv.project_id = :projectId AND pv.type = 'version' LIMIT 5)
WHERE pv.project_id = :projectId AND pv.type = 'version' AND p.visibility = 0 LIMIT 5)
UNION ALL
(SELECT pv.version_id,
pv."type",
@ -134,7 +134,7 @@ public interface HangarVersionsDAO {
FROM pinned_versions pv
JOIN project_versions p ON pv.version_id = p.id
JOIN project_channels pc on pc.id = p.channel_id
WHERE pv.project_id = :projectId AND pv.type = 'channel' LIMIT 1)
WHERE pv.project_id = :projectId AND pv.type = 'channel' AND p.visibility = 0 LIMIT 1)
""")
@RegisterConstructorMapper(HangarProject.PinnedVersion.class)
List<HangarProject.PinnedVersion> getPinnedVersions(long projectId);