ugly-app 0.1.197 → 0.1.199

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export declare const CLI_VERSION = "0.1.197";
1
+ export declare const CLI_VERSION = "0.1.199";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Auto-generated by prebuild — do not edit manually
2
- export const CLI_VERSION = "0.1.197";
2
+ export const CLI_VERSION = "0.1.199";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugly-app",
3
- "version": "0.1.197",
3
+ "version": "0.1.199",
4
4
  "type": "module",
5
5
  "main": "./dist/server/index.js",
6
6
  "exports": {
@@ -1,2 +1,2 @@
1
1
  // Auto-generated by prebuild — do not edit manually
2
- export const CLI_VERSION = "0.1.197";
2
+ export const CLI_VERSION = "0.1.199";
@@ -37,22 +37,22 @@ const app = createApp(
37
37
  createTodo: async (userId, { text }) => {
38
38
  const _id = crypto.randomUUID();
39
39
  const todo: Todo = { _id, userId, text, done: false, ...dbDefaults() };
40
- await app.db.setDoc('todo', todo);
40
+ await app.db.setDoc(collections.todo, todo);
41
41
  return { id: _id };
42
42
  },
43
43
 
44
44
  toggleTodo: async (userId, { todoId }) => {
45
- const todo = await app.db.getDoc<Todo>('todo', todoId);
45
+ const todo = await app.db.getDoc(collections.todo, todoId);
46
46
  if (!todo?.userId || todo.userId !== userId) throw new Error('Todo not found');
47
47
  const updated: Todo = { ...todo, done: !todo.done, ...dbDefaults() };
48
- await app.db.setDoc('todo', updated);
48
+ await app.db.setDoc(collections.todo, updated);
49
49
  return { done: updated.done };
50
50
  },
51
51
 
52
52
  deleteTodo: async (userId, { todoId }) => {
53
- const todo = await app.db.getDoc<Todo>('todo', todoId);
53
+ const todo = await app.db.getDoc(collections.todo, todoId);
54
54
  if (!todo?.userId || todo.userId !== userId) throw new Error('Todo not found');
55
- await app.db.deleteDoc('todo', todoId);
55
+ await app.db.deleteDoc(collections.todo, todoId);
56
56
  return { ok: true };
57
57
  },
58
58