From e38336e845925439555119e8dc899d788bc1a193 Mon Sep 17 00:00:00 2001 From: CIS Guru Date: Sat, 28 Sep 2024 13:19:38 -0500 Subject: [PATCH] See changes.md for a list of revisions. --- v4/favicon.ico | Bin 0 -> 15406 bytes v4/src/components/BookForm/BookForm.jsx | 15 ++++----------- 2 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 v4/favicon.ico diff --git a/v4/favicon.ico b/v4/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..960fdd88892aae2c11e23cc4fd7fe626f9f6fd95 GIT binary patch literal 15406 zcmeGjS&$P&bUgmW4}UR>f{37~h>Ay1YIzl&C6*Sb{AgJoRifpM79Lnq>W2qf%I?B) zBgd{B%K~!k!g9(X3Kk&Cas-eiGn33rGLvN5_d4mx^z0-v*-Z8*(p9tR>FIv&_3PKK z`yDF?7YUaL{rU;;8xmf=R1iiAf)EO2-UnYU2({2Qe0cWzAVFxoLJ$T+9~c57GVSo= zTFzJZ|2R?|(%~URK6(jb8LqD2Wn(-2%D+8MQsQBv?fQoM7F+iUv>%~Qbk%t7n{&?b zy+0CSrbu+zleC{WcLXux5rV~NUsrG}g;g_v7$;juN^T?K%xj6!)mbg#k)&fMN%Gu2Iu`#Z8z=f2%jOennqZAJj;$?fEW*GstT0|M*j~TNhKXz_Nl8aZ zD)J8z>#p-fgEVg>L0(}oj;+q{LOD(JV{1sHrpgnB(f&Ifi)$v%y@mFVu6%~BskZ0) zg5#qrpCzgD2kE1%dzI^}?VL*6qsyM)+P!$;<9jK4pp-pG$GR$oA{tT8gy0zs59+6U zg-jMM?)c@(Nx+Y=51s_Y<1pf+xT`7dpx_n-rz3;AJLm1BuP1RkX{o&1&)V9nN#fu< z&~K~h6W?Fs$)DKTm#qG5T;lLj5}9$0=UBJBNA+VmN%bcFQCi;53kP+onaG@n)&Que zTPEclxRHtd5D1~>h>=zxS4ZNw7#*5y7>dEk6%26`bmrKA*LRs z;LTKm$V=|0@QwD|eSqP{drlC1chZCMO-z%bNp}22l;(FBO6%9uV?4@*0 zX5k`cI#XY~{AX=g#%kmlcBcKnEg$)TMFlm+`b zm8*_Cb}R8cKa?H6()_L)>TH`yl=ZKbjRtA{C|AB~yS@g!pV2>NGEU_BF=e2k3T&s& zGH)DTPjSW8z6dq$$$#yp0k(RI{h`Q}F*M4qe z-P-UBa~3aqnL87}UXL|B-!&R)2g3bpF42!Pa1WkAZnWClwB6rYV-g2u1ttr29F=;} zeyM!x){{06wL^PqEgd#+ck&^OwlCV>`TPPGN;~>Vz(p%efTxh31U?Iqp9fslF}?qI zkeAj-O-So0x$(rCp{o6i=VxDuX@p5`R=Y8Dtrl^FW}pVt{6+S9bXb{=U3LFZvCWq-vYvFdclHW zhnJ~OCDB#SkqG!%gFKJqB@b|R7`0!(hZ^5sP2+xkamfvjkaYC8)BLgC)7pOo<5GU% z`R`XnFkWi6;}9wOTw;ymeBl%8h7$eI5*XCkKgK42euGHuRleZ)r#*Kcz__SsUhr!|357$G?bZFi=NQ>`- z81X4?jQu4gx0lIBljA*GFXVOd%q}~6x+c_D=Mu9;KX*R=8Uis>I@Jw9?^#B#+po0n zF5qXFn*+vzrC&$$YXJI2-SQFa8;$F0f5F&+ID0rht{ct~jQOY4Gj>wIKT!|+Z=gks z402syXC9Rz!sFU1yRQ5K|(Re0c+`%fKQ`K#sX6dP-aW57du==nH_<_`J@(<_Z z1@33PZ52?I@lzscY4t44Cvo$qGtzNRdRrqAXI4UcyFUJz&B0O!Tk^T&R0;^upBBk zK8bT~;&QDK4%)x*eLofDM{i^w}8!pF@3-Hn`q;BEAO1aG*fZ#Q$AgmyEVc^yD(otexiTQa}Bd=BZ5xVAU6qR z$6iv>zX0bk-*9~4L!T?;!K<4;q`3+Bjfjk literal 0 HcmV?d00001 diff --git a/v4/src/components/BookForm/BookForm.jsx b/v4/src/components/BookForm/BookForm.jsx index f765dfe..9514d21 100644 --- a/v4/src/components/BookForm/BookForm.jsx +++ b/v4/src/components/BookForm/BookForm.jsx @@ -36,16 +36,9 @@ export function BookForm({ function saveBook(e) { if (selectedBook.id) { - updateBooks( - books.map((b) => { - if (b.id === selectedBook.id) { - return selectedBook; - } - return b; - }) - ); - updateBook({}); - e.preventDefault(); + const bookIndex = books.findIndex((b) => b.id === selectedBook.id); + books[bookIndex] = book; + updateBooks([...books]); return; } book.id = new Date().getTime(); @@ -53,7 +46,7 @@ export function BookForm({ updateBook({ ...book }); updateBooks([...books, book]); - book = {}; + clearForm(e); e.preventDefault(); }