Skip to content

Commit 6141cc7

Browse files
committed
fix: conflict
1 parent a632fed commit 6141cc7

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/trpc/routers/update/procedures/get-updates.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export const getUpdatesProcedure = withAuth.query(async ({ ctx }) => {
1212
where: {
1313
companyId: user.companyId,
1414
},
15-
15+
include: {
16+
recipients: true,
17+
},
1618
orderBy: {
1719
createdAt: "desc",
1820
},
@@ -22,7 +24,7 @@ export const getUpdatesProcedure = withAuth.query(async ({ ctx }) => {
2224
});
2325

2426
export const getRecipientsProcedure = withAuth
25-
.input(z.object({ updateId: z.string(), publicUpdateId: z.string() }))
27+
.input(z.object({ updateId: z.string() }))
2628
.query(async ({ ctx, input }) => {
2729
const {
2830
db,

src/trpc/routers/update/procedures/toggle-update-visibility.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { Audit } from "@/server/audit";
33
import { checkMembership } from "@/server/auth";
44
import { withAuth } from "@/trpc/api/trpc";
55
import { TRPCError } from "@trpc/server";
6-
import { ToggleUpdateStatusSchema } from "../schema";
6+
import { z } from "zod";
77

88
export const toggleUpdateVisibilityProcedure = withAuth
9-
.input(ToggleUpdateStatusSchema)
9+
.input(z.object({ updateId: z.string() }))
1010
.mutation(async ({ ctx: { db, session, requestIp, userAgent }, input }) => {
1111
try {
1212
const authorId = session.user.memberId;

src/trpc/routers/update/router.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import {
99
shareUpdateProcedure,
1010
unshareUpdateProcedure,
1111
} from "./procedures/share-update";
12+
import { toggleUpdateVisibilityProcedure } from "./procedures/toggle-update-visibility";
1213

1314
export const updateRouter = createTRPCRouter({
1415
save: saveUpdateProcedure,
1516
get: getUpdatesProcedure,
16-
getRecipiants: getRecipientsProcedure,
17+
getRecipients: getRecipientsProcedure,
1718
clone: cloneUpdateProcedure,
1819
share: shareUpdateProcedure,
1920
unShare: unshareUpdateProcedure,
21+
toggleVisibility: toggleUpdateVisibilityProcedure,
2022
});

0 commit comments

Comments
 (0)