@axium/notes 0.3.2 → 0.3.3

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 -4
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { checkAuthForItem, checkAuthForUser } from '@axium/server/auth';
1
+ import { authRequestForItem, checkAuthForUser } from '@axium/server/auth';
2
2
  import { database } from '@axium/server/database';
3
3
  import { parseBody, withError } from '@axium/server/requests';
4
4
  import { addRoute } from '@axium/server/routes';
@@ -31,12 +31,12 @@ addRoute({
31
31
  path: '/api/notes/:id',
32
32
  params: { id: z.uuid() },
33
33
  async GET(request, { id }) {
34
- const { item } = await checkAuthForItem(request, 'notes', id, { read: true });
34
+ const { item } = await authRequestForItem(request, 'notes', id, { read: true });
35
35
  return item;
36
36
  },
37
37
  async PATCH(request, { id }) {
38
38
  const init = await parseBody(request, NoteInit);
39
- await checkAuthForItem(request, 'notes', id, { edit: true });
39
+ await authRequestForItem(request, 'notes', id, { edit: true });
40
40
  return await database
41
41
  .updateTable('notes')
42
42
  .set(init)
@@ -47,7 +47,7 @@ addRoute({
47
47
  .catch(withError('Could not update note'));
48
48
  },
49
49
  async DELETE(request, { id }) {
50
- await checkAuthForItem(request, 'notes', id, { manage: true });
50
+ await authRequestForItem(request, 'notes', id, { manage: true });
51
51
  return await database
52
52
  .deleteFrom('notes')
53
53
  .where('id', '=', id)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/notes",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "Notes for Axium",
6
6
  "funding": {
@@ -37,7 +37,7 @@
37
37
  "peerDependencies": {
38
38
  "@axium/client": ">=0.13.0",
39
39
  "@axium/core": ">=0.19.0",
40
- "@axium/server": ">=0.34.0",
40
+ "@axium/server": ">=0.35.0",
41
41
  "@sveltejs/kit": "^2.27.3",
42
42
  "utilium": "^2.4.0"
43
43
  },