mirror of
https://github.com/strapi/strapi.git
synced 2025-09-16 12:02:41 +00:00
Merge pull request #16307 from strapi/fix/500-error-localizations
This commit is contained in:
commit
c58b405b44
@ -31,7 +31,7 @@ const assignDefaultLocaleToEntries = async (data) => {
|
|||||||
* @param {Object} options.model corresponding model
|
* @param {Object} options.model corresponding model
|
||||||
*/
|
*/
|
||||||
const syncLocalizations = async (entry, { model }) => {
|
const syncLocalizations = async (entry, { model }) => {
|
||||||
if (Array.isArray(entry.localizations)) {
|
if (Array.isArray(entry?.localizations)) {
|
||||||
const newLocalizations = [entry.id, ...entry.localizations.map(prop('id'))];
|
const newLocalizations = [entry.id, ...entry.localizations.map(prop('id'))];
|
||||||
|
|
||||||
const updateLocalization = (id) => {
|
const updateLocalization = (id) => {
|
||||||
@ -56,7 +56,7 @@ const syncLocalizations = async (entry, { model }) => {
|
|||||||
const syncNonLocalizedAttributes = async (entry, { model }) => {
|
const syncNonLocalizedAttributes = async (entry, { model }) => {
|
||||||
const { copyNonLocalizedAttributes } = getService('content-types');
|
const { copyNonLocalizedAttributes } = getService('content-types');
|
||||||
|
|
||||||
if (Array.isArray(entry.localizations)) {
|
if (Array.isArray(entry?.localizations)) {
|
||||||
const nonLocalizedAttributes = copyNonLocalizedAttributes(model, entry);
|
const nonLocalizedAttributes = copyNonLocalizedAttributes(model, entry);
|
||||||
|
|
||||||
if (isEmpty(nonLocalizedAttributes)) {
|
if (isEmpty(nonLocalizedAttributes)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user