-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create flow of creation/retrieval of user post-auth (#26)
* wip: Adds minimal user creation in DB * wip: Adds minimal user creation in DB --------- Co-authored-by: Juliano <jchoi@42sp.org.br> Co-authored-by: lenzo <lenzo@mail.com>
- Loading branch information
1 parent
65bc8c0
commit bfddc99
Showing
20 changed files
with
156 additions
and
167 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -102,3 +102,6 @@ dist | |
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# PostgreSQL directory | ||
postgres/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { UsersModule } from './modules/users/users.module'; | ||
import { UsersModule } from './users/users.module'; | ||
import { PrismaService } from './prisma/prisma.service'; | ||
import { PrismaModule } from './prisma/prisma.module'; | ||
|
||
@Module({ | ||
imports: [UsersModule], | ||
imports: [UsersModule, PrismaModule], | ||
controllers: [], | ||
providers: [], | ||
providers: [PrismaService], | ||
}) | ||
export class AppModule {} |
13 changes: 0 additions & 13 deletions
13
backend/src/database/migrations/20230408001327_test_compose/migration.sql
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Global, Module } from '@nestjs/common'; | ||
import { PrismaService } from './prisma.service'; | ||
|
||
@Global() | ||
@Module({ | ||
providers: [PrismaService], | ||
exports: [PrismaService], | ||
}) | ||
export class PrismaModule {} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { PrismaClient } from '@prisma/client'; | ||
|
||
@Injectable() | ||
export class PrismaService extends PrismaClient { | ||
constructor() { | ||
super(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { IsString } from 'class-validator'; | ||
export class CreateUserDto { | ||
@IsString() | ||
login: string; | ||
|
||
@IsString() | ||
displayName: string; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Controller, Get, Body } from '@nestjs/common'; | ||
import { UsersService } from './users.service'; | ||
|
||
@Controller('users') | ||
export class UsersController { | ||
constructor(private service: UsersService) {} | ||
|
||
@Get('me') | ||
findMe(@Body() dto: any) { | ||
return this.service.findMe(dto); | ||
} | ||
} |
Oops, something went wrong.