mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-07 09:55:43 -04:00
feat: consolidate entities create
This was done to give better typings to the function signatures of entities `create` methods. It also ensures that each field that should be set to `null` is set to `null` and doesn't leave that up to the typeorm handlers. See: #1641 Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
bb7561b9ad
commit
b896f954b9
14 changed files with 89 additions and 40 deletions
|
@ -43,11 +43,12 @@ export class Group {
|
|||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
private constructor() {}
|
||||
|
||||
public static create(name: string, displayName: string): Group {
|
||||
public static create(name: string, displayName: string): Omit<Group, 'id'> {
|
||||
const newGroup = new Group();
|
||||
newGroup.special = false; // this attribute should only be true for the two special groups
|
||||
newGroup.name = name;
|
||||
newGroup.displayName = displayName;
|
||||
newGroup.special = false; // this attribute should only be true for the two special groups
|
||||
newGroup.members = [];
|
||||
return newGroup;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue