Skip to content

Commit 375ceec

Browse files
committed
chore: minor refactoring in update-files
1 parent 15539f8 commit 375ceec

File tree

1 file changed

+2
-23
lines changed
  • src/app/(authenticated)/(dashboard)/[publicId]/updates/[updatePublicId]

1 file changed

+2
-23
lines changed
Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"use server";
2-
import type { ExtendedRecipientType } from "@/components/common/share-modal";
32
import { db } from "@/server/db";
4-
import { api } from "@/trpc/server";
5-
63
import dynamic from "next/dynamic";
74

85
const Editor = dynamic(
@@ -16,35 +13,17 @@ const getUpdate = async (publicId: string) => {
1613
});
1714
};
1815

19-
const getContacts = async () => {
20-
return await api.common.getContacts.query();
21-
};
22-
2316
const UpdatePage = async ({
2417
params: { publicId, updatePublicId },
2518
}: {
2619
params: { publicId: string; updatePublicId: string };
2720
}) => {
28-
const contacts = await getContacts();
29-
3021
if (updatePublicId === "new") {
31-
return <Editor companyPublicId={publicId} contacts={contacts} mode="new" />;
22+
return <Editor companyPublicId={publicId} mode="new" />;
3223
}
3324
const update = await getUpdate(updatePublicId);
34-
const recipients = await api.update.getRecipiants.query({
35-
updateId: update?.id,
36-
publicUpdateId: update.publicId,
37-
});
3825

39-
return (
40-
<Editor
41-
companyPublicId={publicId}
42-
update={update}
43-
contacts={contacts}
44-
recipients={recipients as object[] as ExtendedRecipientType[]}
45-
mode="edit"
46-
/>
47-
);
26+
return <Editor companyPublicId={publicId} update={update} mode="edit" />;
4827
};
4928

5029
export default UpdatePage;

0 commit comments

Comments
 (0)