Worked on the schema code

This commit is contained in:
2020-09-05 00:05:56 +10:00
parent e9655f1055
commit 7fa4c56bcc
6 changed files with 43 additions and 31 deletions

View File

@@ -21,7 +21,7 @@ let authors = [
},
];
//insert the authors into the books
//insert the authors into the books (relationship)
authors = authors.map(a => {
a.books = a.books.map(b => {
b.author = a;
@@ -39,4 +39,4 @@ authors.forEach(a => books = books.concat(a.books));
module.exports = {
authors,
books,
};
};