@@ -3,7 +3,7 @@ import { z } from "zod";
33
44import { getClientFor } from "@ctrlplane/workspace-engine-sdk" ;
55
6- import { protectedProcedure , router } from "../trpc.js" ;
6+ import { protectedProcedure } from "../ ../trpc.js" ;
77
88const getOneReleaseTarget = async (
99 workspaceId : string ,
@@ -53,24 +53,22 @@ const getPolicyResults = async (
5353 return decision . data ?. versionDecision ?. policyResults ?? [ ] ;
5454} ;
5555
56- export const environmentVersionRouter = router ( {
57- policyResults : protectedProcedure
58- . input (
59- z . object ( {
60- workspaceId : z . uuid ( ) ,
61- environmentId : z . uuid ( ) ,
62- versionId : z . uuid ( ) ,
63- } ) ,
64- )
65- . query ( async ( { input } ) => {
66- const { workspaceId, environmentId, versionId } = input ;
67- const version = await getDeploymentVersion ( workspaceId , versionId ) ;
68- const releaseTarget = await getOneReleaseTarget (
69- workspaceId ,
70- environmentId ,
71- version . deploymentId ,
72- ) ;
73- if ( releaseTarget == null ) return [ ] ;
74- return getPolicyResults ( workspaceId , releaseTarget , version ) ;
56+ export const policyResults = protectedProcedure
57+ . input (
58+ z . object ( {
59+ workspaceId : z . uuid ( ) ,
60+ environmentId : z . uuid ( ) ,
61+ versionId : z . uuid ( ) ,
7562 } ) ,
76- } ) ;
63+ )
64+ . query ( async ( { input } ) => {
65+ const { workspaceId, environmentId, versionId } = input ;
66+ const version = await getDeploymentVersion ( workspaceId , versionId ) ;
67+ const releaseTarget = await getOneReleaseTarget (
68+ workspaceId ,
69+ environmentId ,
70+ version . deploymentId ,
71+ ) ;
72+ if ( releaseTarget == null ) return [ ] ;
73+ return getPolicyResults ( workspaceId , releaseTarget , version ) ;
74+ } ) ;
0 commit comments