(obj)
| 54 | }; |
| 55 | |
| 56 | const updateHabit = (obj) => { |
| 57 | return new Promise((resolve, reject) => { |
| 58 | db.transaction((tx) => { |
| 59 | tx.executeSql( |
| 60 | "UPDATE habits SET habitName=?, habitFrequency=?, habitHasNotification=?, habitNotificationFrequency=?, habitNotificationTime=? WHERE habitArea=?;", |
| 61 | [ |
| 62 | obj.habitName, |
| 63 | obj.habitFrequency, |
| 64 | obj.habitHasNotification, |
| 65 | obj.habitNotificationFrequency, |
| 66 | obj.habitNotificationTime, |
| 67 | obj.habitArea, |
| 68 | ], |
| 69 | (_, { rowsAffected }) => { |
| 70 | if (rowsAffected > 0) resolve(rowsAffected); |
| 71 | else reject("Error updating obj"); |
| 72 | }, |
| 73 | (_, error) => reject(error) |
| 74 | ); |
| 75 | }); |
| 76 | }); |
| 77 | }; |
| 78 | |
| 79 | const deleteByName = (habitArea) => { |
| 80 | return new Promise((resolve, reject) => { |
nothing calls this directly
no outgoing calls
no test coverage detected