mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +00:00
chore: reverse connect array to ensure relations are connected before positioning
This commit is contained in:
parent
e241d0ce37
commit
1bde22fdd9
@ -125,7 +125,7 @@ const cleanData = ({ browserState, serverState }, currentSchema, componentsSchem
|
||||
|
||||
cleanedData = {
|
||||
disconnect: disconnectedRelations,
|
||||
connect: connectedRelations,
|
||||
connect: connectedRelations.reverse(),
|
||||
};
|
||||
|
||||
break;
|
||||
|
@ -826,8 +826,8 @@ describe('CM || components || EditViewDataManagerProvider || utils || cleanData'
|
||||
expect(result).toStrictEqual({
|
||||
relation: {
|
||||
connect: [
|
||||
{ id: 1, position: { before: 2 } },
|
||||
{ id: 2, position: { end: true } },
|
||||
{ id: 1, position: { before: 2 } },
|
||||
],
|
||||
disconnect: [],
|
||||
},
|
||||
@ -851,12 +851,12 @@ describe('CM || components || EditViewDataManagerProvider || utils || cleanData'
|
||||
expect(result).toStrictEqual({
|
||||
relation: {
|
||||
connect: [
|
||||
{ id: 2, position: { end: true } },
|
||||
{ id: 1, position: { before: 2 } },
|
||||
{
|
||||
id: 3,
|
||||
position: { before: 1 },
|
||||
},
|
||||
{ id: 1, position: { before: 2 } },
|
||||
{ id: 2, position: { end: true } },
|
||||
],
|
||||
disconnect: [],
|
||||
},
|
||||
@ -880,14 +880,14 @@ describe('CM || components || EditViewDataManagerProvider || utils || cleanData'
|
||||
expect(result).toStrictEqual({
|
||||
relation: {
|
||||
connect: [
|
||||
{
|
||||
id: 3,
|
||||
position: { before: 4 },
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
position: { end: true },
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
position: { before: 4 },
|
||||
},
|
||||
],
|
||||
disconnect: [],
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user