Skip to content

Commit 1fee627

Browse files
committed
fix add attendee call, mv s3 to lib
1 parent 915c2d0 commit 1fee627

5 files changed

Lines changed: 20 additions & 8 deletions

File tree

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import { S3Client as AWSS3Client, GetObjectCommand } from "@aws-sdk/client-s3";
22
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
3-
import type { MainConfig } from "~/config.server";
43

54
type Deps = {
6-
mainConfig: MainConfig;
5+
mainConfig: {
6+
s3: {
7+
accessKeyId: string;
8+
secretAccessKey: string;
9+
region: string;
10+
url: string;
11+
bucket: string;
12+
}
13+
}
714
};
815

916
export type S3Client = ReturnType<typeof createS3Client>;

website/app/modules/allthingsweb/client.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SpeakerWithTalkIds, TalkWithEventCtx } from "./speakers";
33
import { Profile } from "./profiles";
44
import { Event, ExpandedEvent, ExpandedTalk, Sponsor } from "./events";
55
import { RedirectLink } from "./redirects";
6-
import { S3Client } from "../s3/client.server";
6+
import { S3Client } from "@lib/s3/client.server";
77
import { MainConfig } from "~/config.server";
88
import { Image } from "./images";
99

website/app/modules/container.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { createPosthogClient } from "./posthog/posthog.server";
1313
import { createDatabaseClient, DatabaseClient } from "@lib/db/client.server";
1414
import { createDbQueryClient, DbQueryClient } from "./db/queries.server";
1515
import { createQueryClient, QueryClient } from "./allthingsweb/client.server";
16-
import { createS3Client, S3Client } from "./s3/client.server";
16+
import { createS3Client, S3Client } from "@lib/s3/client.server";
1717

1818
export const buildContainer = () => {
1919
// 1. load the config

website/app/modules/homepage/homepage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { inArray } from "drizzle-orm";
22
import { DatabaseClient } from "@lib/db/client.server";
3-
import { S3Client } from "../s3/client.server";
3+
import { S3Client } from "@lib/s3/client.server";
44
import { imagesTable } from "@lib/db/schema.server";
55
import { Image } from "../allthingsweb/images";
66

website/app/modules/luma/api.server.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,20 @@ export const createLumaClient = ({ mainConfig, logger }: Deps) => {
210210

211211
const addAttendees = async (
212212
eventId: string,
213-
data: { email: string; name: string | null }[],
213+
guests: { email: string; name: string | null }[],
214214
) => {
215-
const url = `https://api.lu.ma/public/v1/event/add-guests?event_api_id=${eventId}`;
215+
const url = `https://api.lu.ma/public/v1/event/add-guests`;
216216
const res = await fetch(url, {
217217
method: "POST",
218218
headers,
219-
body: JSON.stringify(data),
219+
body: JSON.stringify({
220+
event_api_id: eventId,
221+
guests,
222+
}),
220223
});
221224
if (!res.ok) {
225+
const resData = await res.json();
226+
console.warn(resData);
222227
throw new Error(
223228
`Failed to add attendee. Status: ${res.status} - ${res.statusText}`,
224229
);

0 commit comments

Comments
 (0)