Skip to content

Commit 110430a

Browse files
committed
fix(book-new): add correct id mapping for json-server
1 parent 15c3188 commit 110430a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/app/book/book-new/book-new.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export class BookNewComponent implements OnInit {
2626
onSubmit() {
2727

2828
const book: Book = {
29-
isbn: '',
29+
id: this.form.value.isbn,
30+
isbn: this.form.value.isbn,
3031
title: this.form.value.title,
3132
author: this.form.value.author,
3233
subtitle: '',

src/app/book/shared/book.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export interface Book {
2+
id?: string,
23
title: string;
34
subtitle: string;
45
isbn: string;

0 commit comments

Comments
 (0)