-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: create sign-up-with-email route
- Loading branch information
1 parent
8f17986
commit 6e6a1dd
Showing
3 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
src/infra/database/prisma/data/user/sign-up-with-email/sign-up-with-email-prisma-repo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import type { UserWithEmailModel } from '@/models/user-with-email-model' | ||
import type { SignUpWithEmailRepo } from '@/usecases/contracts/db/user/sign-up-with-email-repo' | ||
import { PrismaHelper } from '../../../helpers' | ||
import { UuidAdapter } from '@/infra/uuid-adapter/uuid-adapter' | ||
|
||
export class SignUpWithEmailPrismaRepo implements SignUpWithEmailRepo { | ||
async execute (data: UserWithEmailModel): Promise<void> { | ||
const id = new UuidAdapter().build() | ||
const prisma = await PrismaHelper.getPrisma() | ||
await prisma.userWithEmail.create({ data }) // TODO: create a userWithEmail model in prisma | ||
const userData = { ...data, id } | ||
await prisma.userWithEmail.create({ data: userData }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters