MCPcopy Index your code
hub / github.com/DeepNotesApp/DeepNotes / getUserIdFromEvent

Function getUserIdFromEvent

apps/app-server/src/fastify/stripe-webhook.ts:48–66  ·  view source on GitHub ↗
(input: {
  event: Stripe.Event;
  dataAbstraction: ReturnType<typeof dataAbstraction>;
})

Source from the content-addressed store, hash-verified

46}
47
48async function getUserIdFromEvent(input: {
49 event: Stripe.Event;
50 dataAbstraction: ReturnType<typeof dataAbstraction>;
51}) {
52 const userId = await input.dataAbstraction.hget(
53 'customer',
54 (input.event.data.object as any).customer,
55 'user-id',
56 );
57
58 if (userId == null) {
59 throw new TRPCError({
60 code: 'NOT_FOUND',
61 message: 'User not found.',
62 });
63 }
64
65 return userId;
66}
67
68async function customerSubscriptionUpdated(input: {
69 event: Stripe.Event;

Callers 2

Calls 1

hgetMethod · 0.45

Tested by

no test coverage detected