File tree 7 files changed +15
-14
lines changed 7 files changed +15
-14
lines changed Original file line number Diff line number Diff line change 1
1
import { excludeProperties , pickProperties } from "typing-assets"
2
2
import { BaseNoteSchema , OperateNoteSchema } from "./base/Note"
3
- import { NOTE_RESPONSES } from "../../../ openapi/responses/NoteResponses"
3
+ import { NOTE_RESPONSES } from "../../openapi/responses/NoteResponses"
4
4
import { FastifySchema } from "../../../shared/utils/typing/FastifySchemaOverride"
5
5
6
6
export const CreateNoteSchema : FastifySchema = {
Original file line number Diff line number Diff line change 1
1
import { FastifySchema } from "../../../shared/utils/typing/FastifySchemaOverride" ;
2
2
import { excludeProperties , pickProperties } from "typing-assets"
3
3
import { BaseUserSchema } from "./base/User"
4
- import { USER_RESPONSES } from "../../../ openapi/responses/UserResponses" ;
4
+ import { USER_RESPONSES } from "../../openapi/responses/UserResponses" ;
5
5
6
6
export const CreateUserSchema : FastifySchema = {
7
7
body : {
Original file line number Diff line number Diff line change 1
1
import { DataSource } from "typeorm" ;
2
- import { UserEntity } from "./entities/User" ;
3
- import { NoteEntity } from "./entities/Note" ;
2
+ import { User as UserEntity } from "./entities/User" ;
3
+ import { Note as NoteEntity } from "./entities/Note" ;
4
4
import { withRetry } from "../shared/decorators/WithRetry" ;
5
5
6
6
@@ -17,7 +17,7 @@ export class DataSourceInitialiser {
17
17
public async initAndGetDataSource ( ) : Promise < DataSource > {
18
18
const appDataSource = new DataSource ( {
19
19
type : "postgres" ,
20
- entities : [ UserEntity . User , NoteEntity . Note ] ,
20
+ entities : [ UserEntity , NoteEntity ] ,
21
21
synchronize : true ,
22
22
logging : false ,
23
23
host : this . host ,
Original file line number Diff line number Diff line change 7
7
ManyToMany ,
8
8
JoinTable
9
9
} from "typeorm" ;
10
- import { UserEntity } from "./User" ;
10
+ import { User as UserEntity } from "./User" ;
11
11
12
12
@Entity ( )
13
13
export class Note {
@@ -34,9 +34,9 @@ export class Note {
34
34
} )
35
35
public tags : string [ ] ;
36
36
37
- @ManyToMany ( ( ) => UserEntity . User , null , { cascade : true } )
37
+ @ManyToMany ( ( ) => UserEntity , null , { cascade : true } )
38
38
@JoinTable ( )
39
- public collaborators : UserEntity . User [ ] ;
39
+ public collaborators : UserEntity [ ] ;
40
40
41
41
@CreateDateColumn ( {
42
42
type : "timestamp" ,
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ export const CONFIG: Config = {
6
6
7
7
databaseHost : process . env . DATABASE_HOST || "localhost" ,
8
8
databasePort : parseInt ( process . env . DATABASE_PORT || "5432" ) ,
9
- databaseName : process . env . DATABASE_NAME || "postgres " ,
9
+ databaseName : process . env . DATABASE_NAME || "NodeNotes " ,
10
10
databaseUser : process . env . DATABASE_USER || "postgres" ,
11
- databasePassword : process . env . DATABASE_PASSWORD || "postgres " ,
11
+ databasePassword : process . env . DATABASE_PASSWORD || "Rrobocopid12 " ,
12
12
13
13
get databaseConnectionString ( ) : string {
14
14
return `postgres://${ this . databaseUser } :${ this . databasePassword } @${ this . databaseHost } :${ this . databasePort } /${ this . databaseName } `
Original file line number Diff line number Diff line change 1
- import { Note , Note as NoteEntity } from "../../../database/entities/Note" ;
1
+ import { Note as NoteEntity } from "../../../database/entities/Note" ;
2
+ import { Note } from "../../dto/NoteDto" ;
2
3
3
4
export const transformNoteCollaborators = ( note : NoteEntity ) : Note => {
4
5
return {
Original file line number Diff line number Diff line change 1
1
import fastify from 'fastify'
2
2
import { CONFIG } from './api/v1/shared/config/ServerConfiguration'
3
3
import { UsersService } from './api/v1/services/users/UsersService'
4
- import { UsersHandler } from './api/v1/handlers/UsersHandlers'
5
4
import { AuthService } from './api/v1/services/auth/AuthService'
6
- import { AuthHandler } from './api/v1/handlers/AuthHandlers'
7
5
import { logRequestMetadata } from './api/v1/api/hooks/onRequestLogger'
8
6
import { logResponseMetadata } from './api/v1/api/hooks/onResponseLogger'
9
7
import { authorizationPreHandlerFactory } from './api/v1/api/prehandlers/AuthPreHandler'
10
- import { NotesHandler } from './api/v1/handlers/NotesHandlers'
11
8
import { NotesService } from './api/v1/services/notes/NotesService'
12
9
import "reflect-metadata"
13
10
import { User as UserEntity } from './api/v1/database/entities/User'
@@ -17,6 +14,9 @@ import { initSwaggerViewer } from './api/v1/api/openapi/swagger/InitSwagger'
17
14
import { connectAndGetRedisInstance } from './api/v1/cache/InitRedisInstance'
18
15
import Healthcheck from './api/v1/shared/utils/common/Healthcheck'
19
16
import { CommonHandler } from './api/v1/api/handlers/common/CommonHandler'
17
+ import { AuthHandler } from './api/v1/api/handlers/auth/AuthHandlers'
18
+ import { NotesHandler } from './api/v1/api/handlers/notes/NotesHandlers'
19
+ import { UsersHandler } from './api/v1/api/handlers/users/UsersHandlers'
20
20
21
21
const main = async ( ) => {
22
22
CONFIG . log ( )
You can’t perform that action at this time.
0 commit comments