mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 09:46:30 -05:00
docs: add dev documentation for create methods
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
09f0d7c389
commit
8c78656f8c
1 changed files with 11 additions and 0 deletions
|
@ -28,3 +28,14 @@ The software provides two special groups which have no explicit users:
|
|||
- Run `yarn install` in both projects
|
||||
- Start the backend server in watch mode using `yarn start:dev`. The backend is then accessible on port 3000.
|
||||
- Start the frontend dev server using `yarn start`. The frontend is now accessible on port 3001.
|
||||
|
||||
## Entity `create` methods
|
||||
|
||||
Because we need to have empty constructors in our entity classes for TypeORM to work, the actual constructor is a separate `create` method. These methods should adhere to these guidelines:
|
||||
|
||||
- Only require the non-optional properties of the corresponding entity
|
||||
- Have no optional parameters
|
||||
- Have no lists which can be empty (so probably most of them)
|
||||
- Should either return a complete and fully useable instance or return a Pick/Omit type.
|
||||
- Exceptions to these rules are allowed, if they are mentioned in the method documentation
|
||||
|
||||
|
|
Loading…
Reference in a new issue