Rename creator fields

This commit is contained in:
Alexandre Bodin 2021-09-22 17:04:57 +02:00
parent 65eba8f63b
commit c5f9d16105
23 changed files with 238 additions and 238 deletions

View File

@ -10,8 +10,8 @@
"short_description": "test test", "short_description": "test test",
"since": "2020-09-02", "since": "2020-09-02",
"description": "test test test test ", "description": "test test test test ",
"created_by": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null }, "createdBy": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null },
"updated_by": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null }, "updatedBy": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null },
"createdAt": "2020-09-01T14:47:53.257Z", "createdAt": "2020-09-01T14:47:53.257Z",
"updatedAt": "2020-09-01T14:47:53.627Z", "updatedAt": "2020-09-01T14:47:53.627Z",
"closing_period": { "closing_period": {
@ -86,8 +86,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:21.346Z", "createdAt": "2020-09-01T14:35:21.346Z",
"updatedAt": "2020-09-01T14:35:21.358Z" "updatedAt": "2020-09-01T14:35:21.358Z"
}, },
@ -96,8 +96,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -105,8 +105,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -114,8 +114,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -182,8 +182,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:38.706Z", "createdAt": "2020-09-01T14:35:38.706Z",
"updatedAt": "2020-09-01T14:35:38.715Z" "updatedAt": "2020-09-01T14:35:38.715Z"
} }
@ -254,8 +254,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:38.706Z", "createdAt": "2020-09-01T14:35:38.706Z",
"updatedAt": "2020-09-01T14:35:38.715Z" "updatedAt": "2020-09-01T14:35:38.715Z"
} }
@ -325,8 +325,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:21.346Z", "createdAt": "2020-09-01T14:35:21.346Z",
"updatedAt": "2020-09-01T14:35:21.358Z" "updatedAt": "2020-09-01T14:35:21.358Z"
} }
@ -350,8 +350,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -359,8 +359,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -368,8 +368,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -387,8 +387,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -396,8 +396,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -405,8 +405,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -431,8 +431,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -440,8 +440,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -449,8 +449,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }

View File

@ -15,13 +15,13 @@
"id": 1, "id": 1,
"description": "menu1", "description": "menu1",
"restaurant": 1, "restaurant": 1,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:47:10.654Z", "createdAt": "2020-09-01T14:47:10.654Z",
"updatedAt": "2020-09-01T14:47:53.568Z" "updatedAt": "2020-09-01T14:47:53.568Z"
}, },
"created_by": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null }, "createdBy": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null },
"updated_by": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null }, "updatedBy": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null },
"createdAt": "2020-09-01T14:47:53.257Z", "createdAt": "2020-09-01T14:47:53.257Z",
"updatedAt": "2020-09-01T14:47:53.627Z", "updatedAt": "2020-09-01T14:47:53.627Z",
@ -44,8 +44,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -53,8 +53,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -62,8 +62,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -81,8 +81,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
}, },
@ -90,8 +90,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
} }
@ -112,8 +112,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -121,8 +121,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -130,8 +130,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }

View File

@ -11,8 +11,8 @@
"postal_coder": "rzerz", "postal_coder": "rzerz",
"city": "rzzerze", "city": "rzzerze",
"publishedAt": "2020-08-31T13:29:02.118Z", "publishedAt": "2020-08-31T13:29:02.118Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-08-31T12:35:46.553Z", "createdAt": "2020-08-31T12:35:46.553Z",
"updatedAt": "2020-08-31T13:29:02.136Z", "updatedAt": "2020-08-31T13:29:02.136Z",
"cover": null, "cover": null,
@ -26,13 +26,13 @@
"id": 1, "id": 1,
"description": "menu1", "description": "menu1",
"restaurant": 1, "restaurant": 1,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:47:10.654Z", "createdAt": "2020-09-01T14:47:10.654Z",
"updatedAt": "2020-09-01T14:47:53.568Z" "updatedAt": "2020-09-01T14:47:53.568Z"
}, },
"created_by": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null }, "createdBy": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null },
"updated_by": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null }, "updatedBy": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null },
"createdAt": "2020-09-01T14:47:53.257Z", "createdAt": "2020-09-01T14:47:53.257Z",
"updatedAt": "2020-09-01T14:47:53.627Z", "updatedAt": "2020-09-01T14:47:53.627Z",
@ -41,8 +41,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
}, },
@ -50,8 +50,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -59,8 +59,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
} }

View File

@ -11,8 +11,8 @@
"postal_coder": "rzerz", "postal_coder": "rzerz",
"city": "rzzerze", "city": "rzzerze",
"publishedAt": "2020-08-31T13:29:02.118Z", "publishedAt": "2020-08-31T13:29:02.118Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-08-31T12:35:46.553Z", "createdAt": "2020-08-31T12:35:46.553Z",
"updatedAt": "2020-08-31T13:29:02.136Z", "updatedAt": "2020-08-31T13:29:02.136Z",
"cover": null, "cover": null,
@ -26,13 +26,13 @@
"id": 1, "id": 1,
"description": "menu1", "description": "menu1",
"restaurant": 1, "restaurant": 1,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:47:10.654Z", "createdAt": "2020-09-01T14:47:10.654Z",
"updatedAt": "2020-09-01T14:47:53.568Z" "updatedAt": "2020-09-01T14:47:53.568Z"
}, },
"created_by": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null }, "createdBy": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null },
"updated_by": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null }, "updatedBy": { "id": 1, "firstname": "cyril", "lastname": "lopez", "username": null },
"createdAt": "2020-09-01T14:47:53.257Z", "createdAt": "2020-09-01T14:47:53.257Z",
"updatedAt": "2020-09-01T14:47:53.627Z", "updatedAt": "2020-09-01T14:47:53.627Z",
"closing_period": { "closing_period": {
@ -107,8 +107,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:21.346Z", "createdAt": "2020-09-01T14:35:21.346Z",
"updatedAt": "2020-09-01T14:35:21.358Z" "updatedAt": "2020-09-01T14:35:21.358Z"
}, },
@ -117,8 +117,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -126,8 +126,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -135,8 +135,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -203,8 +203,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:38.706Z", "createdAt": "2020-09-01T14:35:38.706Z",
"updatedAt": "2020-09-01T14:35:38.715Z" "updatedAt": "2020-09-01T14:35:38.715Z"
} }
@ -275,8 +275,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:38.706Z", "createdAt": "2020-09-01T14:35:38.706Z",
"updatedAt": "2020-09-01T14:35:38.715Z" "updatedAt": "2020-09-01T14:35:38.715Z"
} }
@ -346,8 +346,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:21.346Z", "createdAt": "2020-09-01T14:35:21.346Z",
"updatedAt": "2020-09-01T14:35:21.358Z" "updatedAt": "2020-09-01T14:35:21.358Z"
} }
@ -371,8 +371,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -380,8 +380,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -389,8 +389,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -408,8 +408,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -417,8 +417,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -426,8 +426,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -452,8 +452,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -461,8 +461,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -470,8 +470,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -499,8 +499,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -508,8 +508,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -517,8 +517,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -536,8 +536,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
}, },
@ -545,8 +545,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
} }
@ -567,8 +567,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
}, },
@ -576,8 +576,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -585,8 +585,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
} }
@ -654,8 +654,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:21.346Z", "createdAt": "2020-09-01T14:35:21.346Z",
"updatedAt": "2020-09-01T14:35:21.358Z" "updatedAt": "2020-09-01T14:35:21.358Z"
}, },
@ -721,8 +721,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:38.706Z", "createdAt": "2020-09-01T14:35:38.706Z",
"updatedAt": "2020-09-01T14:35:38.715Z" "updatedAt": "2020-09-01T14:35:38.715Z"
}, },
@ -787,8 +787,8 @@
"previewUrl": null, "previewUrl": null,
"provider": "local", "provider": "local",
"provider_metadata": null, "provider_metadata": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T14:35:21.346Z", "createdAt": "2020-09-01T14:35:21.346Z",
"updatedAt": "2020-09-01T14:35:21.358Z" "updatedAt": "2020-09-01T14:35:21.358Z"
} }
@ -798,8 +798,8 @@
"id": 3, "id": 3,
"name": "cat3", "name": "cat3",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:51.438Z", "createdAt": "2020-09-01T12:05:51.438Z",
"updatedAt": "2020-09-01T12:05:51.444Z" "updatedAt": "2020-09-01T12:05:51.444Z"
}, },
@ -807,8 +807,8 @@
"id": 1, "id": 1,
"name": "cat1", "name": "cat1",
"publishedAt": null, "publishedAt": null,
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T08:37:15.012Z", "createdAt": "2020-09-01T08:37:15.012Z",
"updatedAt": "2020-09-01T12:37:33.249Z" "updatedAt": "2020-09-01T12:37:33.249Z"
}, },
@ -816,8 +816,8 @@
"id": 2, "id": 2,
"name": "cat2", "name": "cat2",
"publishedAt": "2020-09-01T13:07:04.235Z", "publishedAt": "2020-09-01T13:07:04.235Z",
"created_by": 1, "createdBy": 1,
"updated_by": 1, "updatedBy": 1,
"createdAt": "2020-09-01T12:05:46.798Z", "createdAt": "2020-09-01T12:05:46.798Z",
"updatedAt": "2020-09-01T13:07:04.253Z" "updatedAt": "2020-09-01T13:07:04.253Z"
} }

View File

@ -23,8 +23,8 @@ const InformationCard = () => {
); );
const updatedBy = useMemo(() => { const updatedBy = useMemo(() => {
const firstname = get(initialData, ['updated_by', 'firstname'], ''); const firstname = get(initialData, ['updatedBy', 'firstname'], '');
const lastname = get(initialData, ['updated_by', 'lastname'], ''); const lastname = get(initialData, ['updatedBy', 'lastname'], '');
return `${firstname} ${lastname}`; return `${firstname} ${lastname}`;
}, [initialData]); }, [initialData]);

View File

@ -50,9 +50,9 @@ describe('CONTENT MANAGER | utils | removeKeyInObject', () => {
const data = { const data = {
id: 1, id: 1,
publishedAt: null, publishedAt: null,
created_by: null, createdBy: null,
__temp_key__: 0, __temp_key__: 0,
updated_by: { updatedBy: {
id: 1, id: 1,
firstname: 'cyril', firstname: 'cyril',
lastname: 'lopez', lastname: 'lopez',
@ -85,8 +85,8 @@ describe('CONTENT MANAGER | utils | removeKeyInObject', () => {
{ {
id: 1, id: 1,
publishedAt: '2020-10-30T08:55:49.686Z', publishedAt: '2020-10-30T08:55:49.686Z',
created_by: null, createdBy: null,
updated_by: null, updatedBy: null,
createdAt: '2020-10-30T08:55:49.694Z', createdAt: '2020-10-30T08:55:49.694Z',
updatedAt: '2020-10-30T08:55:49.694Z', updatedAt: '2020-10-30T08:55:49.694Z',
}, },
@ -113,8 +113,8 @@ describe('CONTENT MANAGER | utils | removeKeyInObject', () => {
const expected = { const expected = {
id: 1, id: 1,
publishedAt: null, publishedAt: null,
created_by: null, createdBy: null,
updated_by: { updatedBy: {
id: 1, id: 1,
firstname: 'cyril', firstname: 'cyril',
lastname: 'lopez', lastname: 'lopez',
@ -145,8 +145,8 @@ describe('CONTENT MANAGER | utils | removeKeyInObject', () => {
{ {
id: 1, id: 1,
publishedAt: '2020-10-30T08:55:49.686Z', publishedAt: '2020-10-30T08:55:49.686Z',
created_by: null, createdBy: null,
updated_by: null, updatedBy: null,
createdAt: '2020-10-30T08:55:49.694Z', createdAt: '2020-10-30T08:55:49.694Z',
updatedAt: '2020-10-30T08:55:49.694Z', updatedAt: '2020-10-30T08:55:49.694Z',
}, },

View File

@ -6,14 +6,14 @@ module.exports = {
displayName: 'Is creator', displayName: 'Is creator',
name: 'is-creator', name: 'is-creator',
plugin: 'admin', plugin: 'admin',
handler: user => ({ 'created_by.id': user.id }), handler: user => ({ 'createdBy.id': user.id }),
}, },
{ {
displayName: 'Has same role as creator', displayName: 'Has same role as creator',
name: 'has-same-role-as-creator', name: 'has-same-role-as-creator',
plugin: 'admin', plugin: 'admin',
handler: user => ({ handler: user => ({
'created_by.roles': { 'createdBy.roles': {
$elemMatch: { $elemMatch: {
id: { id: {
$in: user.roles.map(r => r.id), $in: user.roles.map(r => r.id),

View File

@ -263,7 +263,7 @@ describe('Permissions Manager', () => {
[ [
'Literal nested property with removable op', 'Literal nested property with removable op',
{ {
'created_by.roles': { 'createdBy.roles': {
$elemMatch: { $elemMatch: {
id: { id: {
$in: [1, 2, 3], $in: [1, 2, 3],
@ -272,7 +272,7 @@ describe('Permissions Manager', () => {
}, },
}, },
{ {
'created_by.roles.id_in': [1, 2, 3], 'createdBy.roles.id_in': [1, 2, 3],
}, },
], ],
]; ];

View File

@ -96,7 +96,7 @@ describe('Permissions Engine', () => {
plugin: 'test', plugin: 'test',
name: 'isCreatedBy', name: 'isCreatedBy',
category: 'default', category: 'default',
handler: user => ({ created_by: user.firstname }), handler: user => ({ createdBy: user.firstname }),
}, },
{ {
plugin: 'test', plugin: 'test',
@ -339,7 +339,7 @@ describe('Permissions Engine', () => {
condition: { condition: {
$and: [ $and: [
{ {
$or: [{ created_by: user.firstname }], $or: [{ createdBy: user.firstname }],
}, },
], ],
}, },
@ -364,7 +364,7 @@ describe('Permissions Engine', () => {
await engine.evaluate({ permission, user, registerFn }); await engine.evaluate({ permission, user, registerFn });
expect(can).toHaveBeenCalledWith('read', 'all', undefined, { expect(can).toHaveBeenCalledWith('read', 'all', undefined, {
$and: [{ $or: [{ created_by: user.firstname }] }], $and: [{ $or: [{ createdBy: user.firstname }] }],
}); });
}); });
@ -389,11 +389,11 @@ describe('Permissions Engine', () => {
action: 'read', action: 'read',
subject: 'article', subject: 'article',
fields: '*', fields: '*',
condition: { created_by: 1 }, condition: { createdBy: 1 },
}); });
expect(can).toHaveBeenCalledTimes(1); expect(can).toHaveBeenCalledTimes(1);
expect(can).toHaveBeenCalledWith('read', 'article', '*', { created_by: 1 }); expect(can).toHaveBeenCalledWith('read', 'article', '*', { createdBy: 1 });
}); });
test(`It should use 'all' as a subject if it's Nil`, async () => { test(`It should use 'all' as a subject if it's Nil`, async () => {
@ -401,11 +401,11 @@ describe('Permissions Engine', () => {
action: 'read', action: 'read',
subject: null, subject: null,
fields: null, fields: null,
condition: { created_by: 1 }, condition: { createdBy: 1 },
}); });
expect(can).toHaveBeenCalledTimes(1); expect(can).toHaveBeenCalledTimes(1);
expect(can).toHaveBeenCalledWith('read', 'all', null, { created_by: 1 }); expect(can).toHaveBeenCalledWith('read', 'all', null, { createdBy: 1 });
}); });
}); });

View File

@ -172,8 +172,8 @@ describe('Single Types', () => {
expect(createFn).toHaveBeenCalledWith( expect(createFn).toHaveBeenCalledWith(
expect.objectContaining({ expect.objectContaining({
title: 'test', title: 'test',
created_by: 1, createdBy: 1,
updated_by: 1, updatedBy: 1,
}), }),
modelUid, modelUid,
{ params: {} } { params: {} }

View File

@ -525,14 +525,14 @@ components:
type: object type: object
required: required:
- id - id
- created_by - createdBy
- updated_by - updatedBy
properties: properties:
id: id:
$ref: '#/components/schemas/id' $ref: '#/components/schemas/id'
created_by: createdBy:
$ref: '#/components/schemas/user' $ref: '#/components/schemas/user'
updated_by: updatedBy:
$ref: '#/components/schemas/user' $ref: '#/components/schemas/user'
additionalProperties: additionalProperties:
type: any type: any

View File

@ -112,8 +112,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
// expect(Array.isArray(body.articles)).toBeTruthy(); // expect(Array.isArray(body.articles)).toBeTruthy();
expect(body.name).toBe('tag1'); expect(body.name).toBe('tag1');
// expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); // expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
// expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); // expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -131,8 +131,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
// expect(Array.isArray(body.articles)).toBeTruthy(); // expect(Array.isArray(body.articles)).toBeTruthy();
expect(body.name).toBe('tag2'); expect(body.name).toBe('tag2');
// expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); // expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
// expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); // expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -150,8 +150,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
// expect(Array.isArray(body.articles)).toBeTruthy(); // expect(Array.isArray(body.articles)).toBeTruthy();
expect(body.name).toBe('tag3'); expect(body.name).toBe('tag3');
// expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); // expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
// expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); // expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -175,8 +175,8 @@ describe('Content Manager End to End', () => {
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
// expect(Array.isArray(body.tags)).toBeTruthy(); // expect(Array.isArray(body.tags)).toBeTruthy();
// expect(body.tags.length).toBe(0); // expect(body.tags.length).toBe(0);
// expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); // expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
// expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); // expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -201,8 +201,8 @@ describe('Content Manager End to End', () => {
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.tags.length).toBe(1); expect(body.tags.length).toBe(1);
expect(body.tags[0].id).toBe(data.tags[0].id); expect(body.tags[0].id).toBe(data.tags[0].id);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -227,8 +227,8 @@ describe('Content Manager End to End', () => {
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.tags.length).toBe(1); expect(body.tags.length).toBe(1);
expect(body.tags[0].id).toBe(data.tags[1].id); expect(body.tags[0].id).toBe(data.tags[1].id);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -254,8 +254,8 @@ describe('Content Manager End to End', () => {
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.tags.length).toBe(3); expect(body.tags.length).toBe(3);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -278,8 +278,8 @@ describe('Content Manager End to End', () => {
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.tags.length).toBe(2); expect(body.tags.length).toBe(2);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -303,8 +303,8 @@ describe('Content Manager End to End', () => {
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.tags.length).toBe(0); expect(body.tags.length).toBe(0);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -414,8 +414,8 @@ describe('Content Manager End to End', () => {
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.tags.length).toBe(1); expect(body.tags.length).toBe(1);
expect(body.tags[0].id).toBe(data.tags[0].id); expect(body.tags[0].id).toBe(data.tags[0].id);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
}); });
@ -445,8 +445,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
expect(Array.isArray(body.articles)).toBeTruthy(); expect(Array.isArray(body.articles)).toBeTruthy();
expect(body.name).toBe('cat1'); expect(body.name).toBe('cat1');
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -464,8 +464,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
expect(Array.isArray(body.articles)).toBeTruthy(); expect(Array.isArray(body.articles)).toBeTruthy();
expect(body.name).toBe('cat2'); expect(body.name).toBe('cat2');
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -489,8 +489,8 @@ describe('Content Manager End to End', () => {
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(body.category.name).toBe(data.categories[0].name); expect(body.category.name).toBe(data.categories[0].name);
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Update article1 with cat2', async () => { test('Update article1 with cat2', async () => {
@ -513,8 +513,8 @@ describe('Content Manager End to End', () => {
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(body.category.name).toBe(data.categories[1].name); expect(body.category.name).toBe(data.categories[1].name);
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Create article2', async () => { test('Create article2', async () => {
@ -535,8 +535,8 @@ describe('Content Manager End to End', () => {
expect(body.title).toBe(entry.title); expect(body.title).toBe(entry.title);
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Update article2 with cat2', async () => { test('Update article2 with cat2', async () => {
@ -559,8 +559,8 @@ describe('Content Manager End to End', () => {
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(body.category.name).toBe(data.categories[1].name); expect(body.category.name).toBe(data.categories[1].name);
expect(Array.isArray(body.tags)).toBeTruthy(); expect(Array.isArray(body.tags)).toBeTruthy();
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Update cat1 with article1', async () => { test('Update cat1 with article1', async () => {
@ -582,8 +582,8 @@ describe('Content Manager End to End', () => {
expect(Array.isArray(body.articles)).toBeTruthy(); expect(Array.isArray(body.articles)).toBeTruthy();
expect(body.articles.length).toBe(1); expect(body.articles.length).toBe(1);
expect(body.name).toBe(entry.name); expect(body.name).toBe(entry.name);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Create cat3 with article1', async () => { test('Create cat3 with article1', async () => {
@ -604,8 +604,8 @@ describe('Content Manager End to End', () => {
expect(Array.isArray(body.articles)).toBeTruthy(); expect(Array.isArray(body.articles)).toBeTruthy();
expect(body.articles.length).toBe(1); expect(body.articles.length).toBe(1);
expect(body.name).toBe(entry.name); expect(body.name).toBe(entry.name);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Get article1 with cat3', async () => { test('Get article1 with cat3', async () => {
@ -616,8 +616,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
expect(body.category.id).toBe(data.categories[2].id); expect(body.category.id).toBe(data.categories[2].id);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Get article2 with cat2', async () => { test('Get article2 with cat2', async () => {
@ -628,8 +628,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
expect(body.category.id).toBe(data.categories[1].id); expect(body.category.id).toBe(data.categories[1].id);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Get cat1 without relations', async () => { test('Get cat1 without relations', async () => {
@ -640,8 +640,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
expect(body.articles.length).toBe(0); expect(body.articles.length).toBe(0);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Get cat2 with article2', async () => { test('Get cat2 with article2', async () => {
@ -653,8 +653,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
expect(body.articles.length).toBe(1); expect(body.articles.length).toBe(1);
expect(body.articles[0].id).toBe(data.articles[1].id); expect(body.articles[0].id).toBe(data.articles[1].id);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Get cat3 with article1', async () => { test('Get cat3 with article1', async () => {
@ -666,8 +666,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
expect(body.articles.length).toBe(1); expect(body.articles.length).toBe(1);
expect(body.articles[0].id).toBe(data.articles[0].id); expect(body.articles[0].id).toBe(data.articles[0].id);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
}); });
@ -696,8 +696,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
expect(body.name).toBe('ref1'); expect(body.name).toBe('ref1');
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Create article1', async () => { test('Create article1', async () => {
@ -717,8 +717,8 @@ describe('Content Manager End to End', () => {
expect(body.id).toBeDefined(); expect(body.id).toBeDefined();
expect(body.title).toBe(entry.title); expect(body.title).toBe(entry.title);
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.publishedAt).toBeUndefined(); expect(body.publishedAt).toBeUndefined();
}); });
@ -741,8 +741,8 @@ describe('Content Manager End to End', () => {
expect(body.title).toBe(entry.title); expect(body.title).toBe(entry.title);
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(body.reference.id).toBe(entry.reference); expect(body.reference.id).toBe(entry.reference);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
test('Create article2 with ref1', async () => { test('Create article2 with ref1', async () => {
@ -764,8 +764,8 @@ describe('Content Manager End to End', () => {
expect(body.title).toBe(entry.title); expect(body.title).toBe(entry.title);
expect(body.content).toBe(entry.content); expect(body.content).toBe(entry.content);
expect(body.reference.id).toBe(entry.reference); expect(body.reference.id).toBe(entry.reference);
expect(body.created_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.createdBy).toMatchObject({ email: 'admin@strapi.io' });
expect(body.updated_by).toMatchObject({ email: 'admin@strapi.io' }); expect(body.updatedBy).toMatchObject({ email: 'admin@strapi.io' });
}); });
}); });

View File

@ -6,7 +6,7 @@ const { createTestBuilder } = require('../../../../test/helpers/builder');
const { createStrapiInstance } = require('../../../../test/helpers/strapi'); const { createStrapiInstance } = require('../../../../test/helpers/strapi');
const { createAuthRequest } = require('../../../../test/helpers/request'); const { createAuthRequest } = require('../../../../test/helpers/request');
const CREATOR_FIELDS = ['updated_by', 'created_by']; const CREATOR_FIELDS = ['updatedBy', 'createdBy'];
const builder = createTestBuilder(); const builder = createTestBuilder();
let strapi; let strapi;

View File

@ -1,7 +1,7 @@
import { get } from 'lodash'; import { get } from 'lodash';
import { getType, getOtherInfos } from './getAttributeInfos'; import { getType, getOtherInfos } from './getAttributeInfos';
const defaultFields = ['created_by', 'updated_by', 'publishedAt', 'id', '_id']; const defaultFields = ['createdBy', 'updatedBy', 'publishedAt', 'id', '_id'];
const contentManagementUtilRemoveFieldsFromData = ( const contentManagementUtilRemoveFieldsFromData = (
data, data,

View File

@ -200,7 +200,7 @@ const findEntityAndCheckPermissions = async (ability, action, model, id) => {
'roles', 'roles',
]); ]);
const fileWithRoles = _.set(_.cloneDeep(file), 'created_by', author); const fileWithRoles = _.set(_.cloneDeep(file), 'createdBy', author);
if (pm.ability.cannot(pm.action, pm.toSubject(fileWithRoles))) { if (pm.ability.cannot(pm.action, pm.toSubject(fileWithRoles))) {
throw strapi.errors.forbidden(); throw strapi.errors.forbidden();

View File

@ -7,8 +7,8 @@ const COLLECTION_TYPE = 'collectionType';
const ID_ATTRIBUTE = 'id'; const ID_ATTRIBUTE = 'id';
const PUBLISHED_AT_ATTRIBUTE = 'publishedAt'; const PUBLISHED_AT_ATTRIBUTE = 'publishedAt';
const CREATED_BY_ATTRIBUTE = 'created_by'; const CREATED_BY_ATTRIBUTE = 'createdBy';
const UPDATED_BY_ATTRIBUTE = 'updated_by'; const UPDATED_BY_ATTRIBUTE = 'updatedBy';
const CREATED_AT_ATTRIBUTE = 'createdAt'; const CREATED_AT_ATTRIBUTE = 'createdAt';
const UPDATED_AT_ATTRIBUTE = 'updatedAt'; const UPDATED_AT_ATTRIBUTE = 'updatedAt';

View File

@ -182,7 +182,7 @@ describe('Test Graphql API End to End', () => {
}); });
}); });
test.skip('List posts with `created_by` and `updated_by`', async () => { test.skip('List posts with `createdBy` and `updatedBy`', async () => {
const res = await graphqlQuery({ const res = await graphqlQuery({
query: /* GraphQL */ ` query: /* GraphQL */ `
{ {
@ -191,10 +191,10 @@ describe('Test Graphql API End to End', () => {
name name
bigint bigint
nullable nullable
created_by { createdBy {
username username
} }
updated_by { updatedBy {
username username
} }
} }
@ -208,7 +208,7 @@ describe('Test Graphql API End to End', () => {
expect(res.body.error).toBeUndefined(); expect(res.body.error).toBeUndefined();
// since the posts are created without AdminUser, it should return null // since the posts are created without AdminUser, it should return null
expect(res.body.data.posts[0].created_by).toBeNull(); expect(res.body.data.posts[0].createdBy).toBeNull();
}); });
test.each([ test.each([

View File

@ -14,8 +14,8 @@ const cleanData = (data, { contentType, components }, initialLocalizations) => {
dataWithoutPasswordsAndRelations.localizations = initialLocalizations; dataWithoutPasswordsAndRelations.localizations = initialLocalizations;
const fieldsToRemove = [ const fieldsToRemove = [
'created_by', 'createdBy',
'updated_by', 'updatedBy',
'publishedAt', 'publishedAt',
'id', 'id',
'_id', '_id',

View File

@ -8,7 +8,7 @@ describe('i18n | Components | CMEditViewCopyLocale | utils', () => {
addresseses: [], addresseses: [],
common: 'common', common: 'common',
createdAt: '2021-03-17T15:34:05.866Z', createdAt: '2021-03-17T15:34:05.866Z',
created_by: { createdBy: {
blocked: null, blocked: null,
email: 'cyril@strapi.io', email: 'cyril@strapi.io',
firstname: 'cyril', firstname: 'cyril',
@ -32,7 +32,7 @@ describe('i18n | Components | CMEditViewCopyLocale | utils', () => {
name: 'name', name: 'name',
publishedAt: null, publishedAt: null,
updatedAt: '2021-03-17T15:34:18.958Z', updatedAt: '2021-03-17T15:34:18.958Z',
updated_by: { updatedBy: {
blocked: null, blocked: null,
email: 'cyril@strapi.io', email: 'cyril@strapi.io',
firstname: 'cyril', firstname: 'cyril',

View File

@ -50,8 +50,8 @@ const addCommonFieldsToInitialDataMiddleware = () => ({ getState, dispatch }) =>
const merged = merge(defaultDataStructure, nonLocalizedFields); const merged = merge(defaultDataStructure, nonLocalizedFields);
const fieldsToRemove = [ const fieldsToRemove = [
'created_by', 'createdBy',
'updated_by', 'updatedBy',
'publishedAt', 'publishedAt',
'id', 'id',
'_id', '_id',

View File

@ -68,7 +68,7 @@ describe('Locales', () => {
expect(setIsDefault).toHaveBeenCalledWith(locale); expect(setIsDefault).toHaveBeenCalledWith(locale);
expect(setDefaultLocale).toHaveBeenCalledWith(locale); expect(setDefaultLocale).toHaveBeenCalledWith(locale);
expect(findByCode).toHaveBeenCalledWith('af'); expect(findByCode).toHaveBeenCalledWith('af');
expect(create).toHaveBeenCalledWith({ created_by: 1, updated_by: 1, ...locale }); expect(create).toHaveBeenCalledWith({ createdBy: 1, updatedBy: 1, ...locale });
expect(ctx.body).toMatchObject(expectedLocales); expect(ctx.body).toMatchObject(expectedLocales);
}); });
@ -105,7 +105,7 @@ describe('Locales', () => {
expect(setIsDefault).toHaveBeenCalledWith(locale); expect(setIsDefault).toHaveBeenCalledWith(locale);
expect(findByCode).toHaveBeenCalledWith('af'); expect(findByCode).toHaveBeenCalledWith('af');
expect(create).toHaveBeenCalledWith({ created_by: 1, updated_by: 1, ...locale }); expect(create).toHaveBeenCalledWith({ createdBy: 1, updatedBy: 1, ...locale });
expect(ctx.body).toMatchObject(expectedLocale); expect(ctx.body).toMatchObject(expectedLocale);
}); });
@ -186,7 +186,7 @@ describe('Locales', () => {
expect(setIsDefault).toHaveBeenCalledWith(updatedLocale); expect(setIsDefault).toHaveBeenCalledWith(updatedLocale);
expect(setDefaultLocale).toHaveBeenCalledWith(updatedLocale); expect(setDefaultLocale).toHaveBeenCalledWith(updatedLocale);
expect(findById).toHaveBeenCalledWith(1); expect(findById).toHaveBeenCalledWith(1);
expect(update).toHaveBeenCalledWith({ id: 1 }, { updated_by: 1, ...updates }); expect(update).toHaveBeenCalledWith({ id: 1 }, { updatedBy: 1, ...updates });
expect(ctx.body).toMatchObject(expectedLocales); expect(ctx.body).toMatchObject(expectedLocales);
}); });

View File

@ -67,16 +67,16 @@
"role": { "role": {
"type": "string" "type": "string"
}, },
"created_by": { "createdBy": {
"type": "string" "type": "string"
}, },
"updated_by": { "updatedBy": {
"type": "string" "type": "string"
} }
} }
} }
}, },
"created_by": { "createdBy": {
"required": ["id", "email"], "required": ["id", "email"],
"properties": { "properties": {
"id": { "id": {
@ -117,7 +117,7 @@
} }
} }
}, },
"updated_by": { "updatedBy": {
"required": ["id", "email"], "required": ["id", "email"],
"properties": { "properties": {
"id": { "id": {
@ -192,7 +192,7 @@
"type": { "type": {
"type": "string" "type": "string"
}, },
"created_by": { "createdBy": {
"required": ["id", "email"], "required": ["id", "email"],
"properties": { "properties": {
"id": { "id": {
@ -233,7 +233,7 @@
} }
} }
}, },
"updated_by": { "updatedBy": {
"required": ["id", "email"], "required": ["id", "email"],
"properties": { "properties": {
"id": { "id": {

View File

@ -207,7 +207,7 @@ module.exports = {
} }
const sanitizedData = pm.pickPermittedFieldsOf(body, { subject: pm.toSubject(user) }); const sanitizedData = pm.pickPermittedFieldsOf(body, { subject: pm.toSubject(user) });
const updateData = _.omit({ ...sanitizedData, updated_by: admin.id }, 'created_by'); const updateData = _.omit({ ...sanitizedData, updatedBy: admin.id }, 'createdBy');
if (_.has(body, 'password') && password === user.password) { if (_.has(body, 'password') && password === user.password) {
delete updateData.password; delete updateData.password;