@isardsat/editorial-server 6.6.4 → 6.7.0
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/dist/routes/data.js +9 -0
- package/package.json +3 -3
package/dist/routes/data.js
CHANGED
|
@@ -131,6 +131,9 @@ export function createDataRoutes(config, storage) {
|
|
|
131
131
|
});
|
|
132
132
|
const schema = await cache.getSchema(storage);
|
|
133
133
|
const collection = content[itemType];
|
|
134
|
+
if (!collection && schema[itemType]) {
|
|
135
|
+
return c.json({});
|
|
136
|
+
}
|
|
134
137
|
if (!collection) {
|
|
135
138
|
return c.notFound();
|
|
136
139
|
}
|
|
@@ -178,11 +181,17 @@ export function createDataRoutes(config, storage) {
|
|
|
178
181
|
},
|
|
179
182
|
description: "Get object ids by type",
|
|
180
183
|
},
|
|
184
|
+
404: {
|
|
185
|
+
description: "Item not found",
|
|
186
|
+
},
|
|
181
187
|
},
|
|
182
188
|
}), async (c) => {
|
|
183
189
|
const { itemType } = c.req.valid("param");
|
|
184
190
|
const { preview } = c.req.valid("query");
|
|
185
191
|
const content = await cache.getContent(storage, { production: !preview });
|
|
192
|
+
if (!content[itemType]) {
|
|
193
|
+
return c.notFound();
|
|
194
|
+
}
|
|
186
195
|
return c.json(Object.keys(content[itemType]));
|
|
187
196
|
});
|
|
188
197
|
app.openapi(createRoute({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isardsat/editorial-server",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"hono": "^4.6.20",
|
|
15
15
|
"yaml": "^2.7.0",
|
|
16
16
|
"zod": "^3.24.1",
|
|
17
|
-
"@isardsat/editorial-admin": "^6.
|
|
18
|
-
"@isardsat/editorial-common": "^6.
|
|
17
|
+
"@isardsat/editorial-admin": "^6.7.0",
|
|
18
|
+
"@isardsat/editorial-common": "^6.7.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@tsconfig/node22": "^22.0.0",
|