@strapi/content-releases 5.0.0-rc.13 → 5.0.0-rc.15

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.
@@ -929,7 +929,7 @@ const createReleaseActionService = ({ strapi: strapi2 }) => {
929
929
  return contentTypesData;
930
930
  };
931
931
  return {
932
- async create(releaseId, action) {
932
+ async create(releaseId, action, { disableUpdateReleaseStatus = false } = {}) {
933
933
  const { validateEntryData, validateUniqueEntry } = getService("release-validation", {
934
934
  strapi: strapi2
935
935
  });
@@ -962,7 +962,9 @@ const createReleaseActionService = ({ strapi: strapi2 }) => {
962
962
  },
963
963
  populate: { release: { select: ["id"] } }
964
964
  });
965
- getService("release", { strapi: strapi2 }).updateReleaseStatus(release2.id);
965
+ if (!disableUpdateReleaseStatus) {
966
+ getService("release", { strapi: strapi2 }).updateReleaseStatus(release2.id);
967
+ }
966
968
  return releaseAction2;
967
969
  },
968
970
  async findPage(releaseId, query) {
@@ -1551,11 +1553,14 @@ const releaseActionController = {
1551
1553
  releaseActionsArgs.map((releaseActionArgs) => validateReleaseAction(releaseActionArgs))
1552
1554
  );
1553
1555
  const releaseActionService = getService("release-action", { strapi });
1556
+ const releaseService = getService("release", { strapi });
1554
1557
  const releaseActions = await strapi.db.transaction(async () => {
1555
1558
  const releaseActions2 = await Promise.all(
1556
1559
  releaseActionsArgs.map(async (releaseActionArgs) => {
1557
1560
  try {
1558
- const action = await releaseActionService.create(releaseId, releaseActionArgs);
1561
+ const action = await releaseActionService.create(releaseId, releaseActionArgs, {
1562
+ disableUpdateReleaseStatus: true
1563
+ });
1559
1564
  return action;
1560
1565
  } catch (error) {
1561
1566
  if (error instanceof AlreadyOnReleaseError) {
@@ -1568,6 +1573,9 @@ const releaseActionController = {
1568
1573
  return releaseActions2;
1569
1574
  });
1570
1575
  const newReleaseActions = releaseActions.filter((action) => action !== null);
1576
+ if (newReleaseActions.length > 0) {
1577
+ releaseService.updateReleaseStatus(releaseId);
1578
+ }
1571
1579
  ctx.created({
1572
1580
  data: newReleaseActions,
1573
1581
  meta: {