11import { db } from "@comp/db" ;
2- import { cache } from "react" ;
32
4- export const findOrganization = cache ( async ( subdomain : string ) => {
3+ export const findOrganization = async ( subdomain : string ) => {
54 const organization = await db . organization . findFirst ( {
65 where : { slug : subdomain } ,
76 } ) ;
@@ -17,30 +16,31 @@ export const findOrganization = cache(async (subdomain: string) => {
1716 return {
1817 ...organization ,
1918 } ;
20- } ) ;
19+ } ;
2120
22- export const getPublishedPolicies = cache ( async ( organizationId : string ) => {
21+ export const getPublishedPolicies = async ( organizationId : string ) => {
2322 const policies = await db . policy . findMany ( {
2423 where : { organizationId, status : "published" } ,
2524 } ) ;
2625
2726 return policies ;
28- } ) ;
29-
30- export const getPublishedPolicy = cache (
31- async ( organizationId : string , policyId : string ) => {
32- const policy = await db . policy . findFirst ( {
33- where : { organizationId, status : "published" , id : policyId } ,
34- } ) ;
27+ } ;
28+
29+ export const getPublishedPolicy = async (
30+ organizationId : string ,
31+ policyId : string ,
32+ ) => {
33+ const policy = await db . policy . findFirst ( {
34+ where : { organizationId, status : "published" , id : policyId } ,
35+ } ) ;
3536
36- return policy ;
37- } ,
38- ) ;
37+ return policy ;
38+ } ;
3939
40- export const getPublishedControls = cache ( async ( organizationId : string ) => {
40+ export const getPublishedControls = async ( organizationId : string ) => {
4141 const controls = await db . task . findMany ( {
4242 where : { organizationId, status : "done" } ,
4343 } ) ;
4444
4545 return controls ;
46- } ) ;
46+ } ;
0 commit comments