Skip to content

Commit f53d4b7

Browse files
authored
Merge pull request #554 from trycompai/lewis/comp-fix-trust-portal-cache
[dev] [carhartlewis] lewis/comp-fix-trust-portal-cache
2 parents a0e330a + 8df3bf5 commit f53d4b7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { 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

Comments
 (0)