File tree Expand file tree Collapse file tree 7 files changed +15
-14
lines changed
Expand file tree Collapse file tree 7 files changed +15
-14
lines changed Original file line number Diff line number Diff line change 11import { excludeProperties , pickProperties } from "typing-assets"
22import { BaseNoteSchema , OperateNoteSchema } from "./base/Note"
3- import { NOTE_RESPONSES } from "../../../ openapi/responses/NoteResponses"
3+ import { NOTE_RESPONSES } from "../../openapi/responses/NoteResponses"
44import { FastifySchema } from "../../../shared/utils/typing/FastifySchemaOverride"
55
66export const CreateNoteSchema : FastifySchema = {
Original file line number Diff line number Diff line change 11import { FastifySchema } from "../../../shared/utils/typing/FastifySchemaOverride" ;
22import { excludeProperties , pickProperties } from "typing-assets"
33import { BaseUserSchema } from "./base/User"
4- import { USER_RESPONSES } from "../../../ openapi/responses/UserResponses" ;
4+ import { USER_RESPONSES } from "../../openapi/responses/UserResponses" ;
55
66export const CreateUserSchema : FastifySchema = {
77 body : {
Original file line number Diff line number Diff line change 11import { 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" ;
44import { withRetry } from "../shared/decorators/WithRetry" ;
55
66
@@ -17,7 +17,7 @@ export class DataSourceInitialiser {
1717 public async initAndGetDataSource ( ) : Promise < DataSource > {
1818 const appDataSource = new DataSource ( {
1919 type : "postgres" ,
20- entities : [ UserEntity . User , NoteEntity . Note ] ,
20+ entities : [ UserEntity , NoteEntity ] ,
2121 synchronize : true ,
2222 logging : false ,
2323 host : this . host ,
Original file line number Diff line number Diff line change 77 ManyToMany ,
88 JoinTable
99} from "typeorm" ;
10- import { UserEntity } from "./User" ;
10+ import { User as UserEntity } from "./User" ;
1111
1212@Entity ( )
1313export class Note {
@@ -34,9 +34,9 @@ export class Note {
3434 } )
3535 public tags : string [ ] ;
3636
37- @ManyToMany ( ( ) => UserEntity . User , null , { cascade : true } )
37+ @ManyToMany ( ( ) => UserEntity , null , { cascade : true } )
3838 @JoinTable ( )
39- public collaborators : UserEntity . User [ ] ;
39+ public collaborators : UserEntity [ ] ;
4040
4141 @CreateDateColumn ( {
4242 type : "timestamp" ,
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ export const CONFIG: Config = {
66
77 databaseHost : process . env . DATABASE_HOST || "localhost" ,
88 databasePort : parseInt ( process . env . DATABASE_PORT || "5432" ) ,
9- databaseName : process . env . DATABASE_NAME || "postgres " ,
9+ databaseName : process . env . DATABASE_NAME || "NodeNotes " ,
1010 databaseUser : process . env . DATABASE_USER || "postgres" ,
11- databasePassword : process . env . DATABASE_PASSWORD || "postgres " ,
11+ databasePassword : process . env . DATABASE_PASSWORD || "Rrobocopid12 " ,
1212
1313 get databaseConnectionString ( ) : string {
1414 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" ;
23
34export const transformNoteCollaborators = ( note : NoteEntity ) : Note => {
45 return {
Original file line number Diff line number Diff line change 11import fastify from 'fastify'
22import { CONFIG } from './api/v1/shared/config/ServerConfiguration'
33import { UsersService } from './api/v1/services/users/UsersService'
4- import { UsersHandler } from './api/v1/handlers/UsersHandlers'
54import { AuthService } from './api/v1/services/auth/AuthService'
6- import { AuthHandler } from './api/v1/handlers/AuthHandlers'
75import { logRequestMetadata } from './api/v1/api/hooks/onRequestLogger'
86import { logResponseMetadata } from './api/v1/api/hooks/onResponseLogger'
97import { authorizationPreHandlerFactory } from './api/v1/api/prehandlers/AuthPreHandler'
10- import { NotesHandler } from './api/v1/handlers/NotesHandlers'
118import { NotesService } from './api/v1/services/notes/NotesService'
129import "reflect-metadata"
1310import { User as UserEntity } from './api/v1/database/entities/User'
@@ -17,6 +14,9 @@ import { initSwaggerViewer } from './api/v1/api/openapi/swagger/InitSwagger'
1714import { connectAndGetRedisInstance } from './api/v1/cache/InitRedisInstance'
1815import Healthcheck from './api/v1/shared/utils/common/Healthcheck'
1916import { 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'
2020
2121const main = async ( ) => {
2222 CONFIG . log ( )
You can’t perform that action at this time.
0 commit comments