From 5b9c52c9de63b9164894ce2f8d563e2df60ba503 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 12 Jun 2018 01:08:14 +0700 Subject: [PATCH 01/12] initial commit --- .DS_Store | Bin 0 -> 8196 bytes package-lock.json | 1920 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 7 +- public/index.html | 109 +++ 4 files changed, 2035 insertions(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100644 package-lock.json create mode 100644 public/index.html diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..061668862b09ebd176881447839d1b0c554ed2fb GIT binary patch literal 8196 zcmeHMYiv|S6h5aEI`>lO6oIyTg|3teO3_^+tvua6cvK`1wx#8{+}(RAH{RY`_ukzC zrKZM+{xBFHiHT@5#D66*F)>l%Pai~$39<1NH75S^m+_x5if3l-61%_;6Qd;DNoLN> zIdkUm&39*Vb^!o;N>&=682}h%A^ChNZjgjsvOSFVK%dwtvv%nQ-l8q+Lj~V0je0?jHx^8{P;$-C?sna* zbJ`AuL;GYXY6kR6GON{@O9a|7 zDb>>G?P-Dg=%v{ShruSIpMq!M96Sf-;Z3**Z^QfWFBgWG2O;Ash@j0@YxL;2*A}OD%tPkj& z8qt{7D(eP)6C<|rd2*;NTXmg-_}Vnt*4h&~-B + + + + + + + yo +
+ + + \ No newline at end of file From 38b349262ffbeb9ae37e1de7b1046db1c1283398 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 12 Jun 2018 15:12:07 +0700 Subject: [PATCH 02/12] fetches books --- public/index.html | 80 +++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/public/index.html b/public/index.html index 88eb5cee47..2b26d3042f 100644 --- a/public/index.html +++ b/public/index.html @@ -18,10 +18,12 @@ constructor(){ super(); this.state = { + subjects: ["Fiction", "Science"], subject: false, - subjects: ["Fiction", "Science"] + books: [{title: "book1"}, {title: "book2"}] }; this.updateSubject = this.updateSubject.bind(this); + this.updateBook = this.updateBook.bind(this); } updateSubject(subject) { fetch('subjects') @@ -33,68 +35,70 @@ }) ); } - fetchSubjects() { - /* NOT IN USE */ - let arrayTest = []; - let subjectButtons = []; - fetch('subjects') - .then((results) => results.json()) - .then((data) => { - data.forEach(function(subject){ - console.log(subject); - arrayTest.push(subject); - console.log(arrayTest); - }); - subjectButtons = arrayTest.map(function(subject, index){ - return