(e)
| 29 | //5 |
| 30 | //Add Transaction |
| 31 | function addTransaction(e){ |
| 32 | e.preventDefault(); |
| 33 | if(text.value.trim() === '' || amount.value.trim() === ''){ |
| 34 | alert('please add text and amount') |
| 35 | }else{ |
| 36 | const transaction = { |
| 37 | id:generateID(), |
| 38 | text:text.value, |
| 39 | amount:+amount.value |
| 40 | } |
| 41 | |
| 42 | transactions.push(transaction); |
| 43 | |
| 44 | addTransactionDOM(transaction); |
| 45 | updateValues(); |
| 46 | updateLocalStorage(); |
| 47 | text.value=''; |
| 48 | amount.value=''; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | |
| 53 | //5.5 |
nothing calls this directly
no test coverage detected