Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always use database in TodoList.telefunc.ts (fix #378) #380

Merged
merged 4 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions boilerplates/telefunc/files/pages/todo/TodoList.telefunc.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// https://telefunc.com

import { todos } from "@batijs/shared-no-db/database/todoItems";
import * as drizzleQueries from "@batijs/drizzle/database/drizzle/queries/todos";
import * as sqliteQueries from "@batijs/sqlite/database/sqlite/queries/todos";
import * as d1Queries from "@batijs/d1-sqlite/database/d1/queries/todos";
Expand All @@ -14,7 +17,6 @@ export async function onNewTodo({ text }: { text: string }) {
const context = getContext();
await d1Queries.insertTodo(context.db, text);
} else {
// This is where you'd persist the data
console.log("Received new todo", { text });
todos.todo.push({ text });
}
}
5 changes: 0 additions & 5 deletions packages/tests/tests/FRAMEWORK+SERVER+DATA.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ await describeBati(({ test, describe, expect, fetch, testMatch, context, beforeA
expect(res.status).toBe(200);
expect(await res.text()).toContain(text);
},
_: async () => {
const res = await fetch("/todo");
expect(res.status).toBe(200);
expect(await res.text()).not.toContain(text);
},
});
});
});
Loading