forked from asimgope1/Ella
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f67096
commit e5dfcc0
Showing
13 changed files
with
837 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// api.js | ||
|
||
import { useQuery } from "react-query"; | ||
|
||
import turso from "./database"; | ||
|
||
const fetchCallLogs = async () => { | ||
const query = "SELECT * FROM call_logs"; | ||
const result = await turso.query(query); | ||
return result; | ||
}; | ||
|
||
export const useCallLogs = () => { | ||
return useQuery("callLogs", fetchCallLogs); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// database.js | ||
|
||
import * as SQLite from "expo-sqlite"; | ||
import Turso from "turso"; | ||
|
||
const db = SQLite.openDatabase("call_logs.db"); | ||
const turso = new Turso(db); | ||
|
||
export default turso; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { Config } from "drizzle-kit"; | ||
export default { | ||
schema: "./db/schema.ts", | ||
out: "./drizzle", | ||
driver: "expo", // <--- very important | ||
} satisfies Config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":"5","dialect":"sqlite","entries":[]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// drizzleOptions.js | ||
|
||
import CallLogContract from "./contracts/CallLogContract.json"; // You'll need to create this file | ||
|
||
const options = { | ||
contracts: [CallLogContract], | ||
}; | ||
|
||
export default options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// sync.js | ||
|
||
const syncCallTasksFromCloud = async () => { | ||
// Implement logic to sync call tasks from the cloud to the mobile app | ||
}; | ||
|
||
export { syncCallTasksFromCloud }; |
Oops, something went wrong.