webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.29k stars 601 forks source link

feat(api-headless-cms): add crud operation to restore entry from trash bin #4064

Closed leopuleo closed 4 months ago

leopuleo commented 5 months ago

Changes

With this PR, developers can restore an entry previously moved to the trash bin.

When an entry has been restored, we add the following fields:

Similar types have been added for the revisionRestoredOn and revisionRestoredBy fields.

Folder verification while restoring an entry

In the restoration process, we verify if the folder referenced by the folderId inside wby_location still exists. If not, we relocate the entry to the ROOT_FOLDER.

This aspect of the business logic is handled by subscribing to restoreEntry event topics and managed in a separate package called api-headless-cms-aco.

Related PR

https://github.com/webiny/webiny-upgrades/pull/29

How Has This Been Tested?

Manually + Jest