Skip to content

Commit

Permalink
fix(docs): make foreign key required and relation properties optional
Browse files Browse the repository at this point in the history
  • Loading branch information
nabdelgadir committed Jul 15, 2019
1 parent b9808ea commit f0811aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/site/decorators/Decorators_repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class TodoList extends Entity {
// other properties

@hasOne(() => TodoListImage)
image: TodoListImage;
image?: TodoListImage;

// etc
}
Expand All @@ -202,7 +202,7 @@ export class TodoListImage extends Entity {
// other properties

@belongsTo(() => TodoList)
todoListId?: number;
todoListId: number;

// etc
}
Expand Down Expand Up @@ -232,7 +232,7 @@ export class TodoList extends Entity {
// other properties

@hasMany(() => Todo)
todos: Todo[];
todos?: Todo[];

// etc
}
Expand All @@ -248,7 +248,7 @@ export class Todo extends Entity {
// other properties

@belongsTo(() => TodoList)
todoListId?: number;
todoListId: number;

// etc
}
Expand Down
2 changes: 1 addition & 1 deletion docs/site/tutorials/todo-list/todo-list-tutorial-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ updating the `TodoRelations` interface to include `todoList`:
export class Todo extends Entity {
// ...properties defined by the CLI...

@property()
@belongsTo(() => TodoList)
todoListId: number;

// ...constructor def...
Expand Down

0 comments on commit f0811aa

Please sign in to comment.