@strapi/content-releases 5.0.0-rc.21 → 5.0.0-rc.23
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/_chunks/{App-JwN_xBnA.mjs → App-Db0aPjrG.mjs} +2 -2
- package/dist/_chunks/{App-JwN_xBnA.mjs.map → App-Db0aPjrG.mjs.map} +1 -1
- package/dist/_chunks/{App-BFo3ibui.js → App-xHZkNTlJ.js} +2 -2
- package/dist/_chunks/{App-BFo3ibui.js.map → App-xHZkNTlJ.js.map} +1 -1
- package/dist/_chunks/{ReleasesSettingsPage-CNMXGcZC.mjs → ReleasesSettingsPage-C3rlM6Kf.mjs} +2 -2
- package/dist/_chunks/{ReleasesSettingsPage-CNMXGcZC.mjs.map → ReleasesSettingsPage-C3rlM6Kf.mjs.map} +1 -1
- package/dist/_chunks/{ReleasesSettingsPage-BanjZwEc.js → ReleasesSettingsPage-DxEYftwd.js} +2 -2
- package/dist/_chunks/{ReleasesSettingsPage-BanjZwEc.js.map → ReleasesSettingsPage-DxEYftwd.js.map} +1 -1
- package/dist/_chunks/{index-Em3KctMx.js → index-CulHY6KM.js} +28 -12
- package/dist/_chunks/index-CulHY6KM.js.map +1 -0
- package/dist/_chunks/{index-C_e6DQb0.mjs → index-Dj_bL2s7.mjs} +28 -12
- package/dist/_chunks/index-Dj_bL2s7.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +17 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +17 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/release.d.ts.map +1 -1
- package/dist/server/src/services/release-action.d.ts.map +1 -1
- package/package.json +10 -10
- package/dist/_chunks/index-C_e6DQb0.mjs.map +0 -1
- package/dist/_chunks/index-Em3KctMx.js.map +0 -1
package/dist/server/index.mjs
CHANGED
|
@@ -914,6 +914,14 @@ const createReleaseActionService = ({ strapi: strapi2 }) => {
|
|
|
914
914
|
validateEntryData(action.contentType, action.entryDocumentId),
|
|
915
915
|
validateUniqueEntry(releaseId, action)
|
|
916
916
|
]);
|
|
917
|
+
const model = strapi2.contentType(action.contentType);
|
|
918
|
+
if (model.kind === "singleType") {
|
|
919
|
+
const document = await strapi2.db.query(model.uid).findOne({ select: ["documentId"] });
|
|
920
|
+
if (!document) {
|
|
921
|
+
throw new errors.NotFoundError(`No entry found for contentType ${action.contentType}`);
|
|
922
|
+
}
|
|
923
|
+
action.entryDocumentId = document.documentId;
|
|
924
|
+
}
|
|
917
925
|
const release2 = await strapi2.db.query(RELEASE_MODEL_UID).findOne({ where: { id: releaseId } });
|
|
918
926
|
if (!release2) {
|
|
919
927
|
throw new errors.NotFoundError(`No release found for id ${releaseId}`);
|
|
@@ -1285,7 +1293,15 @@ const releaseController = {
|
|
|
1285
1293
|
const releaseService = getService("release", { strapi });
|
|
1286
1294
|
const query = await permissionsManager.sanitizeQuery(ctx.query);
|
|
1287
1295
|
await validatefindByDocumentAttachedParams(query);
|
|
1288
|
-
const
|
|
1296
|
+
const model = strapi.getModel(query.contentType);
|
|
1297
|
+
if (model.kind && model.kind === "singleType") {
|
|
1298
|
+
const document = await strapi.db.query(model.uid).findOne({ select: ["documentId"] });
|
|
1299
|
+
if (!document) {
|
|
1300
|
+
throw new errors.NotFoundError(`No entry found for contentType ${query.contentType}`);
|
|
1301
|
+
}
|
|
1302
|
+
query.entryDocumentId = document.documentId;
|
|
1303
|
+
}
|
|
1304
|
+
const { contentType, hasEntryAttached, entryDocumentId, locale } = query;
|
|
1289
1305
|
const isEntryAttached = typeof hasEntryAttached === "string" ? Boolean(JSON.parse(hasEntryAttached)) : false;
|
|
1290
1306
|
if (isEntryAttached) {
|
|
1291
1307
|
const releases = await releaseService.findMany({
|