@strapi/content-manager 5.0.0-rc.0 → 5.0.0-rc.2
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/{ComponentConfigurationPage-DVY3LwHo.js → ComponentConfigurationPage-Bv-IXOYu.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DVY3LwHo.js.map → ComponentConfigurationPage-Bv-IXOYu.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-Dy9BQQ2V.mjs → ComponentConfigurationPage-BxJCkKZV.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-Dy9BQQ2V.mjs.map → ComponentConfigurationPage-BxJCkKZV.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DbR8mWH5.mjs → EditConfigurationPage-BGwHNypQ.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DbR8mWH5.mjs.map → EditConfigurationPage-BGwHNypQ.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-b6V7YHfo.js → EditConfigurationPage-QZl5zOz-.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-b6V7YHfo.js.map → EditConfigurationPage-QZl5zOz-.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-CPrukwtO.mjs → EditViewPage-CtdtssrH.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-CPrukwtO.mjs.map → EditViewPage-CtdtssrH.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-DhttErmY.js → EditViewPage-DxKueadW.js} +3 -3
- package/dist/_chunks/{EditViewPage-DhttErmY.js.map → EditViewPage-DxKueadW.js.map} +1 -1
- package/dist/_chunks/{Field-CBRV4uan.js → Field-BPw8fE3W.js} +8 -8
- package/dist/_chunks/Field-BPw8fE3W.js.map +1 -0
- package/dist/_chunks/{Field-DrgIgQPw.mjs → Field-BU7_nR4F.mjs} +8 -8
- package/dist/_chunks/Field-BU7_nR4F.mjs.map +1 -0
- package/dist/_chunks/{Form-Bk3v7Frl.js → Form-DtvmbGdZ.js} +2 -2
- package/dist/_chunks/{Form-Bk3v7Frl.js.map → Form-DtvmbGdZ.js.map} +1 -1
- package/dist/_chunks/{Form-Dxk4txLJ.mjs → Form-ffghBTPI.mjs} +2 -2
- package/dist/_chunks/{Form-Dxk4txLJ.mjs.map → Form-ffghBTPI.mjs.map} +1 -1
- package/dist/_chunks/{History-xNH_9UuV.js → History-CSr8y9KM.js} +21 -11
- package/dist/_chunks/History-CSr8y9KM.js.map +1 -0
- package/dist/_chunks/{History-DSU-y4Hg.mjs → History-D6PRyNcx.mjs} +21 -11
- package/dist/_chunks/History-D6PRyNcx.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BWwZ-uMJ.mjs → ListConfigurationPage-BC9bCi9k.mjs} +2 -2
- package/dist/_chunks/{ListConfigurationPage-BWwZ-uMJ.mjs.map → ListConfigurationPage-BC9bCi9k.mjs.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BCPzXk5W.js → ListConfigurationPage-DsmAQ3YM.js} +2 -2
- package/dist/_chunks/{ListConfigurationPage-BCPzXk5W.js.map → ListConfigurationPage-DsmAQ3YM.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-D9UmehuA.mjs → ListViewPage-B1GyNqfn.mjs} +3 -3
- package/dist/_chunks/{ListViewPage-D9UmehuA.mjs.map → ListViewPage-B1GyNqfn.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-ZIvstfvl.js → ListViewPage-DqAIb_ie.js} +3 -3
- package/dist/_chunks/{ListViewPage-ZIvstfvl.js.map → ListViewPage-DqAIb_ie.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CstnyWv2.mjs → NoContentTypePage-CJ-HJriz.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CstnyWv2.mjs.map → NoContentTypePage-CJ-HJriz.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-h7FcuMjI.js → NoContentTypePage-xjvn5XwY.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-h7FcuMjI.js.map → NoContentTypePage-xjvn5XwY.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-aFCCLbsf.mjs → NoPermissionsPage--afHbbbD.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-aFCCLbsf.mjs.map → NoPermissionsPage--afHbbbD.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DofU68cO.js → NoPermissionsPage-DObTkKmZ.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DofU68cO.js.map → NoPermissionsPage-DObTkKmZ.js.map} +1 -1
- package/dist/_chunks/{Relations-7v66IP7b.mjs → Relations-heq-nLGU.mjs} +3 -3
- package/dist/_chunks/{Relations-7v66IP7b.mjs.map → Relations-heq-nLGU.mjs.map} +1 -1
- package/dist/_chunks/{Relations-DAS_DKG5.js → Relations-t4Q0DpqW.js} +3 -3
- package/dist/_chunks/{Relations-DAS_DKG5.js.map → Relations-t4Q0DpqW.js.map} +1 -1
- package/dist/_chunks/{index-CAlLHIrI.js → index-1zxclxo_.js} +83 -62
- package/dist/_chunks/index-1zxclxo_.js.map +1 -0
- package/dist/_chunks/{index-DIQ7Io-l.mjs → index-BcQ8cRyl.mjs} +85 -64
- package/dist/_chunks/index-BcQ8cRyl.mjs.map +1 -0
- package/dist/_chunks/{layout-DHe2GdT4.mjs → layout-Jl9mJFJZ.mjs} +3 -3
- package/dist/_chunks/{layout-DHe2GdT4.mjs.map → layout-Jl9mJFJZ.mjs.map} +1 -1
- package/dist/_chunks/{layout-B1ZS-usI.js → layout-tVvbqota.js} +3 -3
- package/dist/_chunks/{layout-B1ZS-usI.js.map → layout-tVvbqota.js.map} +1 -1
- package/dist/_chunks/{relations-yXHkSG1Z.js → relations-CK2Jd0HM.js} +2 -2
- package/dist/_chunks/{relations-yXHkSG1Z.js.map → relations-CK2Jd0HM.js.map} +1 -1
- package/dist/_chunks/{relations-BUieBWhT.mjs → relations-f4Pv7Kgo.mjs} +2 -2
- package/dist/_chunks/{relations-BUieBWhT.mjs.map → relations-f4Pv7Kgo.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/server/index.js +33 -28
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +33 -28
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/_chunks/Field-CBRV4uan.js.map +0 -1
- package/dist/_chunks/Field-DrgIgQPw.mjs.map +0 -1
- package/dist/_chunks/History-DSU-y4Hg.mjs.map +0 -1
- package/dist/_chunks/History-xNH_9UuV.js.map +0 -1
- package/dist/_chunks/index-CAlLHIrI.js.map +0 -1
- package/dist/_chunks/index-DIQ7Io-l.mjs.map +0 -1
package/dist/server/index.mjs
CHANGED
@@ -1569,9 +1569,11 @@ const multipleLocaleSchema = yup$1.lazy(
|
|
1569
1569
|
(value) => Array.isArray(value) ? yup$1.array().of(singleLocaleSchema.required()) : singleLocaleSchema
|
1570
1570
|
);
|
1571
1571
|
const statusSchema = yup$1.mixed().oneOf(["draft", "published"], "Invalid status");
|
1572
|
-
const getDocumentLocaleAndStatus = async (request, opts = { allowMultipleLocales: false }) => {
|
1572
|
+
const getDocumentLocaleAndStatus = async (request, model, opts = { allowMultipleLocales: false }) => {
|
1573
1573
|
const { allowMultipleLocales } = opts;
|
1574
|
-
const { locale, status, ...rest } = request || {};
|
1574
|
+
const { locale, status: providedStatus, ...rest } = request || {};
|
1575
|
+
const defaultStatus = contentTypes$1.hasDraftAndPublish(strapi.getModel(model)) ? void 0 : "published";
|
1576
|
+
const status = providedStatus !== void 0 ? providedStatus : defaultStatus;
|
1575
1577
|
const schema = yup$1.object().shape({
|
1576
1578
|
locale: allowMultipleLocales ? multipleLocaleSchema : singleLocaleSchema,
|
1577
1579
|
status: statusSchema
|
@@ -1619,7 +1621,7 @@ const createDocument = async (ctx, opts) => {
|
|
1619
1621
|
const setCreator = setCreatorFields({ user });
|
1620
1622
|
const sanitizeFn = async.pipe(pickPermittedFields, setCreator);
|
1621
1623
|
const sanitizedBody = await sanitizeFn(body);
|
1622
|
-
const { locale, status
|
1624
|
+
const { locale, status } = await getDocumentLocaleAndStatus(body, model);
|
1623
1625
|
return documentManager2.create(model, {
|
1624
1626
|
data: sanitizedBody,
|
1625
1627
|
locale,
|
@@ -1638,7 +1640,7 @@ const updateDocument = async (ctx, opts) => {
|
|
1638
1640
|
}
|
1639
1641
|
const permissionQuery = await permissionChecker2.sanitizedQuery.update(ctx.query);
|
1640
1642
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).build();
|
1641
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
1643
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
1642
1644
|
const [documentVersion, documentExists] = await Promise.all([
|
1643
1645
|
documentManager2.findOne(id, model, { populate, locale, status: "draft" }),
|
1644
1646
|
documentManager2.exists(model, id)
|
@@ -1676,7 +1678,7 @@ const collectionTypes = {
|
|
1676
1678
|
}
|
1677
1679
|
const permissionQuery = await permissionChecker2.sanitizedQuery.read(query);
|
1678
1680
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).populateDeep(1).countRelations({ toOne: false, toMany: true }).build();
|
1679
|
-
const { locale, status } = await getDocumentLocaleAndStatus(query);
|
1681
|
+
const { locale, status } = await getDocumentLocaleAndStatus(query, model);
|
1680
1682
|
const { results: documents, pagination: pagination2 } = await documentManager2.findPage(
|
1681
1683
|
{ ...permissionQuery, populate, locale, status },
|
1682
1684
|
model
|
@@ -1711,7 +1713,7 @@ const collectionTypes = {
|
|
1711
1713
|
}
|
1712
1714
|
const permissionQuery = await permissionChecker2.sanitizedQuery.read(ctx.query);
|
1713
1715
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).populateDeep(Infinity).countRelations().build();
|
1714
|
-
const { locale, status
|
1716
|
+
const { locale, status } = await getDocumentLocaleAndStatus(ctx.query, model);
|
1715
1717
|
const version = await documentManager2.findOne(id, model, {
|
1716
1718
|
populate,
|
1717
1719
|
locale,
|
@@ -1778,7 +1780,7 @@ const collectionTypes = {
|
|
1778
1780
|
}
|
1779
1781
|
const permissionQuery = await permissionChecker2.sanitizedQuery.create(ctx.query);
|
1780
1782
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).build();
|
1781
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
1783
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
1782
1784
|
const document = await documentManager2.findOne(id, model, {
|
1783
1785
|
populate,
|
1784
1786
|
locale,
|
@@ -1823,7 +1825,7 @@ const collectionTypes = {
|
|
1823
1825
|
}
|
1824
1826
|
const permissionQuery = await permissionChecker2.sanitizedQuery.delete(ctx.query);
|
1825
1827
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).build();
|
1826
|
-
const { locale } = await getDocumentLocaleAndStatus(ctx.query);
|
1828
|
+
const { locale } = await getDocumentLocaleAndStatus(ctx.query, model);
|
1827
1829
|
const documentLocales = await documentManager2.findLocales(id, model, { populate, locale });
|
1828
1830
|
if (documentLocales.length === 0) {
|
1829
1831
|
return ctx.notFound();
|
@@ -1856,7 +1858,7 @@ const collectionTypes = {
|
|
1856
1858
|
if (permissionChecker2.cannot.publish(document)) {
|
1857
1859
|
throw new errors.ForbiddenError();
|
1858
1860
|
}
|
1859
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
1861
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
1860
1862
|
const publishResult = await documentManager2.publish(document.documentId, model, {
|
1861
1863
|
locale
|
1862
1864
|
// TODO: Allow setting creator fields on publish
|
@@ -1883,7 +1885,9 @@ const collectionTypes = {
|
|
1883
1885
|
}
|
1884
1886
|
const permissionQuery = await permissionChecker2.sanitizedQuery.publish(ctx.query);
|
1885
1887
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).populateDeep(Infinity).countRelations().build();
|
1886
|
-
const { locale } = await getDocumentLocaleAndStatus(body, {
|
1888
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model, {
|
1889
|
+
allowMultipleLocales: true
|
1890
|
+
});
|
1887
1891
|
const entityPromises = documentIds.map(
|
1888
1892
|
(documentId) => documentManager2.findLocales(documentId, model, { populate, locale, isPublished: false })
|
1889
1893
|
);
|
@@ -1910,7 +1914,7 @@ const collectionTypes = {
|
|
1910
1914
|
if (permissionChecker2.cannot.unpublish()) {
|
1911
1915
|
return ctx.forbidden();
|
1912
1916
|
}
|
1913
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
1917
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
1914
1918
|
const entityPromises = documentIds.map(
|
1915
1919
|
(documentId) => documentManager2.findLocales(documentId, model, { locale, isPublished: true })
|
1916
1920
|
);
|
@@ -1943,7 +1947,7 @@ const collectionTypes = {
|
|
1943
1947
|
}
|
1944
1948
|
const permissionQuery = await permissionChecker2.sanitizedQuery.unpublish(ctx.query);
|
1945
1949
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).build();
|
1946
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
1950
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
1947
1951
|
const document = await documentManager2.findOne(id, model, {
|
1948
1952
|
populate,
|
1949
1953
|
locale,
|
@@ -1980,7 +1984,7 @@ const collectionTypes = {
|
|
1980
1984
|
}
|
1981
1985
|
const permissionQuery = await permissionChecker2.sanitizedQuery.discard(ctx.query);
|
1982
1986
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).build();
|
1983
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
1987
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
1984
1988
|
const document = await documentManager2.findOne(id, model, {
|
1985
1989
|
populate,
|
1986
1990
|
locale,
|
@@ -2011,7 +2015,7 @@ const collectionTypes = {
|
|
2011
2015
|
}
|
2012
2016
|
const permissionQuery = await permissionChecker2.sanitizedQuery.delete(query);
|
2013
2017
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).build();
|
2014
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
2018
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
2015
2019
|
const documentLocales = await documentManager2.findLocales(documentIds, model, {
|
2016
2020
|
populate,
|
2017
2021
|
locale
|
@@ -2038,7 +2042,7 @@ const collectionTypes = {
|
|
2038
2042
|
}
|
2039
2043
|
const permissionQuery = await permissionChecker2.sanitizedQuery.read(ctx.query);
|
2040
2044
|
const populate = await getService$1("populate-builder")(model).populateFromQuery(permissionQuery).build();
|
2041
|
-
const { locale, status
|
2045
|
+
const { locale, status } = await getDocumentLocaleAndStatus(ctx.query, model);
|
2042
2046
|
const entity = await documentManager2.findOne(id, model, { populate, locale, status });
|
2043
2047
|
if (!entity) {
|
2044
2048
|
return ctx.notFound();
|
@@ -2566,7 +2570,7 @@ const createOrUpdateDocument = async (ctx, opts) => {
|
|
2566
2570
|
throw new errors.ForbiddenError();
|
2567
2571
|
}
|
2568
2572
|
const sanitizedQuery = await permissionChecker2.sanitizedQuery.update(query);
|
2569
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
2573
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
2570
2574
|
const [documentVersion, otherDocumentVersion] = await Promise.all([
|
2571
2575
|
findDocument(sanitizedQuery, model, { locale, status: "draft" }),
|
2572
2576
|
// Find the first document to check if it exists
|
@@ -2607,7 +2611,7 @@ const singleTypes = {
|
|
2607
2611
|
return ctx.forbidden();
|
2608
2612
|
}
|
2609
2613
|
const permissionQuery = await permissionChecker2.sanitizedQuery.read(query);
|
2610
|
-
const { locale, status } = await getDocumentLocaleAndStatus(query);
|
2614
|
+
const { locale, status } = await getDocumentLocaleAndStatus(query, model);
|
2611
2615
|
const version = await findDocument(permissionQuery, model, { locale, status });
|
2612
2616
|
if (!version) {
|
2613
2617
|
if (permissionChecker2.cannot.create()) {
|
@@ -2652,7 +2656,7 @@ const singleTypes = {
|
|
2652
2656
|
}
|
2653
2657
|
const sanitizedQuery = await permissionChecker2.sanitizedQuery.delete(query);
|
2654
2658
|
const populate = await buildPopulateFromQuery(sanitizedQuery, model);
|
2655
|
-
const { locale } = await getDocumentLocaleAndStatus(query);
|
2659
|
+
const { locale } = await getDocumentLocaleAndStatus(query, model);
|
2656
2660
|
const documentLocales = await documentManager2.findLocales(void 0, model, {
|
2657
2661
|
populate,
|
2658
2662
|
locale
|
@@ -2689,7 +2693,7 @@ const singleTypes = {
|
|
2689
2693
|
if (permissionChecker2.cannot.publish(document)) {
|
2690
2694
|
throw new errors.ForbiddenError();
|
2691
2695
|
}
|
2692
|
-
const { locale } = await getDocumentLocaleAndStatus(document);
|
2696
|
+
const { locale } = await getDocumentLocaleAndStatus(document, model);
|
2693
2697
|
const publishResult = await documentManager2.publish(document.documentId, model, { locale });
|
2694
2698
|
return publishResult.at(0);
|
2695
2699
|
});
|
@@ -2712,7 +2716,7 @@ const singleTypes = {
|
|
2712
2716
|
return ctx.forbidden();
|
2713
2717
|
}
|
2714
2718
|
const sanitizedQuery = await permissionChecker2.sanitizedQuery.unpublish(query);
|
2715
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
2719
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
2716
2720
|
const document = await findDocument(sanitizedQuery, model, { locale });
|
2717
2721
|
if (!document) {
|
2718
2722
|
return ctx.notFound();
|
@@ -2744,7 +2748,7 @@ const singleTypes = {
|
|
2744
2748
|
return ctx.forbidden();
|
2745
2749
|
}
|
2746
2750
|
const sanitizedQuery = await permissionChecker2.sanitizedQuery.discard(query);
|
2747
|
-
const { locale } = await getDocumentLocaleAndStatus(body);
|
2751
|
+
const { locale } = await getDocumentLocaleAndStatus(body, model);
|
2748
2752
|
const document = await findDocument(sanitizedQuery, model, { locale, status: "published" });
|
2749
2753
|
if (!document) {
|
2750
2754
|
return ctx.notFound();
|
@@ -2764,7 +2768,7 @@ const singleTypes = {
|
|
2764
2768
|
const { query } = ctx.request;
|
2765
2769
|
const documentManager2 = getService$1("document-manager");
|
2766
2770
|
const permissionChecker2 = getService$1("permission-checker").create({ userAbility, model });
|
2767
|
-
const { locale } = await getDocumentLocaleAndStatus(query);
|
2771
|
+
const { locale } = await getDocumentLocaleAndStatus(query, model);
|
2768
2772
|
if (permissionChecker2.cannot.read()) {
|
2769
2773
|
return ctx.forbidden();
|
2770
2774
|
}
|
@@ -2785,7 +2789,7 @@ const uid$1 = {
|
|
2785
2789
|
async generateUID(ctx) {
|
2786
2790
|
const { contentTypeUID, field, data } = await validateGenerateUIDInput(ctx.request.body);
|
2787
2791
|
const { query = {} } = ctx.request;
|
2788
|
-
const { locale } = await getDocumentLocaleAndStatus(query);
|
2792
|
+
const { locale } = await getDocumentLocaleAndStatus(query, contentTypeUID);
|
2789
2793
|
await validateUIDField(contentTypeUID, field);
|
2790
2794
|
const uidService = getService$1("uid");
|
2791
2795
|
ctx.body = {
|
@@ -2797,7 +2801,7 @@ const uid$1 = {
|
|
2797
2801
|
ctx.request.body
|
2798
2802
|
);
|
2799
2803
|
const { query = {} } = ctx.request;
|
2800
|
-
const { locale } = await getDocumentLocaleAndStatus(query);
|
2804
|
+
const { locale } = await getDocumentLocaleAndStatus(query, contentTypeUID);
|
2801
2805
|
await validateUIDField(contentTypeUID, field);
|
2802
2806
|
const uidService = getService$1("uid");
|
2803
2807
|
const isAvailable = await uidService.checkUIDAvailability({
|
@@ -3722,6 +3726,10 @@ const getDeepPopulateDraftCount = (uid2) => {
|
|
3722
3726
|
const attribute = model.attributes[attributeName];
|
3723
3727
|
switch (attribute.type) {
|
3724
3728
|
case "relation": {
|
3729
|
+
const isMorphRelation = attribute.relation.toLowerCase().startsWith("morph");
|
3730
|
+
if (isMorphRelation) {
|
3731
|
+
break;
|
3732
|
+
}
|
3725
3733
|
if (isVisibleAttribute$1(model, attributeName)) {
|
3726
3734
|
populateAcc[attributeName] = {
|
3727
3735
|
count: true,
|
@@ -4207,10 +4215,7 @@ const documentManager = ({ strapi: strapi2 }) => {
|
|
4207
4215
|
async clone(id, body, uid2) {
|
4208
4216
|
const populate = await buildDeepPopulate(uid2);
|
4209
4217
|
const params = {
|
4210
|
-
data:
|
4211
|
-
...omitIdField(body),
|
4212
|
-
[PUBLISHED_AT_ATTRIBUTE]: null
|
4213
|
-
},
|
4218
|
+
data: omitIdField(body),
|
4214
4219
|
populate
|
4215
4220
|
};
|
4216
4221
|
return strapi2.documents(uid2).clone({ ...params, documentId: id }).then((result) => result?.entries.at(0));
|