@axium/tasks 0.4.6 → 0.4.7

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.
Files changed (2) hide show
  1. package/dist/server.js +4 -5
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -13,14 +13,13 @@ addRoute({
13
13
  const lists = await database
14
14
  .selectFrom('task_lists')
15
15
  .selectAll()
16
- .select(eb => jsonArrayFrom(eb.selectFrom('tasks').selectAll().whereRef('tasks.listId', '=', 'task_lists.id')).as('tasks'))
16
+ .select(eb => jsonArrayFrom(eb.selectFrom('tasks').selectAll().whereRef('tasks.listId', '=', 'task_lists.id'))
17
+ .$castTo()
18
+ .as('tasks'))
17
19
  .where('userId', '=', userId)
18
20
  .execute()
19
21
  .catch(withError('Could not get task lists'));
20
- return lists.map(list => ({
21
- ...list,
22
- tasks: list.tasks.map(t => ({ ...t, created: new Date(t.created), due: t.due ? new Date(t.due) : null })),
23
- }));
22
+ return lists;
24
23
  },
25
24
  async PUT(request, { id: userId }) {
26
25
  const init = await parseBody(request, TaskListInit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/tasks",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "Tasks for Axium",
6
6
  "funding": {
@@ -35,7 +35,7 @@
35
35
  "build": "tsc"
36
36
  },
37
37
  "peerDependencies": {
38
- "@axium/client": ">=0.13.0",
38
+ "@axium/client": ">=0.17.0",
39
39
  "@axium/core": ">=0.19.0",
40
40
  "@axium/server": ">=0.35.0",
41
41
  "@sveltejs/kit": "^2.27.3",