docs: general fixes and overall changes (#7258)

* editing halfway

* edited second half

* adjust starter steps

* fix build

* typo fix
This commit is contained in:
Shahed Nasser
2024-05-07 18:00:28 +02:00
committed by GitHub
parent 8db62827ac
commit 327e446974
57 changed files with 872 additions and 1849 deletions
@@ -48,10 +48,12 @@ export default class MySoftDeletable {
---
## Managing Soft-Deletable Models
## Manage Soft-Deletable Models
Services extending the service factory have methods to soft delete and restore records for all models specified during its creation.
### Soft Delete a Record
For example, to soft delete a `MySoftDeletable` record:
```ts
@@ -62,6 +64,25 @@ await helloModuleService.softDelete([
The method receives an array of IDs of records to delete.
### Retrieve Soft-Deleted Records
The `retrieve`, `list`, and `listAndCount` methods accept as a second parameter a configuration object.
To retrieve soft-deleted records, set `withDeleted` to `true` in the configuration object passed as a second parameter.
For example:
```ts
const deletedRecords = await helloModuleService
.listMySoftDeletables({
// ...
}, {
withDeleted: true
})
```
### Restore a Soft-Deleted Record
To restore a `MySoftDeletable` record:
```ts
@@ -72,4 +93,4 @@ await helloModuleService.restore([
The method also receives an array of IDs of records to restore.
If the data model isn't the main data model, its method names are `softDelete` and `restore` suffixed with the plural name of the model. For example, `softDeleteMySoftDeletable`.
If the data model isn't the main data model, its method names are `softDelete` and `restore` suffixed with the plural name of the model. For example, `softDeleteMySoftDeletable`.