MCPcopy Create free account
hub / github.com/OneBitCodeBlog/onebitlife / changeProgress

Function changeProgress

src/Services/HabitsService.js:94–108  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

92};
93
94const changeProgress = (obj) => {
95 return new Promise((resolve, reject) => {
96 db.transaction((tx) => {
97 tx.executeSql(
98 "UPDATE habits SET progressBar=? WHERE habitArea=?;",
99 [obj.progressBar, obj.habitArea],
100 (_, { rowsAffected }) => {
101 if (rowsAffected > 0) resolve(rowsAffected);
102 else reject("Error updating obj");
103 },
104 (_, error) => reject(error)
105 );
106 });
107 });
108};
109export default {
110 createHabit,
111 findByArea,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected