mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-06 06:39:18 -05:00
feat(api): add email subscription endpoints to new API (#54000)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
import { type Prisma } from '@prisma/client';
|
||||
import { customAlphabet } from 'nanoid';
|
||||
|
||||
export const nanoidCharSet =
|
||||
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
const nanoid = customAlphabet(nanoidCharSet, 21);
|
||||
|
||||
/**
|
||||
* Creates the necessary data to create a new user.
|
||||
@@ -52,7 +57,7 @@ export function createUserInput(email: string): Prisma.userCreateInput {
|
||||
keyboardShortcuts: false,
|
||||
location: '',
|
||||
name: '',
|
||||
unsubscribeId: '',
|
||||
unsubscribeId: nanoid(),
|
||||
partiallyCompletedChallenges: [], // TODO(Post-MVP): Omit this from the document? (prisma will always return [])
|
||||
picture: '',
|
||||
portfolio: [], // TODO(Post-MVP): Omit this from the document? (prisma will always return [])
|
||||
|
||||
Reference in New Issue
Block a user