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

Function findByArea

src/Services/HabitsService.js:41–54  ·  view source on GitHub ↗
(habitArea)

Source from the content-addressed store, hash-verified

39};
40
41const findByArea = (habitArea) => {
42 return new Promise((resolve, reject) => {
43 db.transaction((tx) => {
44 tx.executeSql(
45 "SELECT * FROM habits WHERE habitArea LIKE ?;",
46 [habitArea],
47 (_, { rows }) => {
48 if (rows.length > 0) resolve(rows._array);
49 },
50 (_, error) => reject(error)
51 );
52 });
53 });
54};
55
56const updateHabit = (obj) => {
57 return new Promise((resolve, reject) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected