@commonpub/layer 0.10.0 → 0.10.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -30,7 +30,7 @@
30
30
  "@aws-sdk/client-s3": "^3.1010.0",
31
31
  "@commonpub/explainer": "^0.7.11",
32
32
  "@commonpub/schema": "^0.10.0",
33
- "@commonpub/server": "^2.32.0",
33
+ "@commonpub/server": "^2.32.1",
34
34
  "@tiptap/core": "^2.11.0",
35
35
  "@tiptap/extension-bold": "^2.11.0",
36
36
  "@tiptap/extension-bullet-list": "^2.11.0",
@@ -57,8 +57,8 @@
57
57
  "@commonpub/docs": "0.6.2",
58
58
  "@commonpub/auth": "0.5.1",
59
59
  "@commonpub/editor": "0.7.9",
60
- "@commonpub/learning": "0.5.0",
61
60
  "@commonpub/ui": "0.8.5",
61
+ "@commonpub/learning": "0.5.0",
62
62
  "@commonpub/protocol": "0.9.9"
63
63
  },
64
64
  "devDependencies": {
@@ -9,8 +9,11 @@ export default defineEventHandler(async (event) => {
9
9
  const db = useDB();
10
10
  const { id } = parseParams(event, { id: 'uuid' });
11
11
 
12
- const deleted = await deleteContentCategory(db, id);
13
- if (!deleted) {
12
+ const result = await deleteContentCategory(db, id);
13
+ if (!result.deleted) {
14
+ if (result.error === 'system_category') {
15
+ throw createError({ statusCode: 403, statusMessage: 'System categories cannot be deleted' });
16
+ }
14
17
  throw createError({ statusCode: 404, statusMessage: 'Category not found' });
15
18
  }
16
19
  return { success: true };