From 89587941ee0ac64fdae283e65a2f81c3072c1557 Mon Sep 17 00:00:00 2001 From: Mathias Vagni Date: Mon, 22 May 2023 16:16:17 +0200 Subject: [PATCH] Remove customer groups from example (#5) --- package-lock.json | 6 ------ package.json | 1 - pages/api/contact-form.ts | 11 ----------- 3 files changed, 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 57de312..1a0f994 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "@types/ua-parser-js": "^0.7.36", "assert-ts": "^0.3.4", "csstype": "^3.1.2", - "lodash": "^4.17.21", "next": "13.3.2", "prettier": "2.8.8", "react": "18.2.0", @@ -3135,11 +3134,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", diff --git a/package.json b/package.json index 31ba3eb..6fbc5c9 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "@types/ua-parser-js": "^0.7.36", "assert-ts": "^0.3.4", "csstype": "^3.1.2", - "lodash": "^4.17.21", "next": "13.3.2", "prettier": "2.8.8", "react": "18.2.0", diff --git a/pages/api/contact-form.ts b/pages/api/contact-form.ts index 9528c94..ba28c5b 100644 --- a/pages/api/contact-form.ts +++ b/pages/api/contact-form.ts @@ -1,6 +1,5 @@ import { inspect } from 'util'; import { PlainClient, UpsertCustomTimelineEntryInput } from '@team-plain/typescript-sdk'; -import _ from 'lodash'; import type { NextApiRequest, NextApiResponse } from 'next'; const apiKey = process.env.PLAIN_API_KEY; @@ -13,8 +12,6 @@ const client = new PlainClient({ apiKey, }); -const customerGroupKeys = ['free-tier', 'design-partner', 'enterprise'] as const; - export type ResponseData = { error: string | null; }; @@ -44,14 +41,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse< }, onCreate: { fullName: body.customer.name, - customerGroupIdentifiers: [ - { - // Here we are picking a random customer group to add the customer to - // for demo purposes but you could use your own logic to decide which group - // a customer should be part of. - customerGroupKey: _.sample(customerGroupKeys), - }, - ], email: { email: body.customer.email, isVerified: true,