Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

simplify createPlainThread

Steven Tey1a20c61c6ed4
diff --git a/apps/web/lib/plain.ts b/apps/web/lib/plain.ts
index e446cf8ae5..723595de69 100644
--- a/apps/web/lib/plain.ts
+++ b/apps/web/lib/plain.ts
@@ -27,13 +27,10 @@ export const upsertPlainCustomer = async (user: PlainUser) => {
export const createPlainThread = async ({
user,
- title,
- components,
+ ...rest
}: {
user: PlainUser;
- title: string;
- components: CreateThreadInput["components"];
-}) => {
+} & Omit<CreateThreadInput, "customerIdentifier">) => {
let plainCustomerId: string | undefined;
const plainCustomer = await plain.getCustomerByEmail({
email: user.email ?? "",
@@ -56,8 +53,7 @@ export const createPlainThread = async ({
customerIdentifier: {
customerId: plainCustomerId,
},
- title,
- components,
+ ...rest,
});
if (error) {