docs: added a service factory reference (#8292)
Added a service factory reference of the generated methods and how to use them. Since the types in the codebase are a bit complex, a generated reference won't provide a valuable result. Instead, this reference is created manually and aims to cover common use cases, providing examples for them. Closes DOCS-844
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
---
|
||||
sidebar_label: "delete"
|
||||
---
|
||||
|
||||
export const metadata = {
|
||||
title: `delete Method - Service Factory Reference`,
|
||||
}
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
This method deletes one or more records.
|
||||
|
||||
## Delete One Record
|
||||
|
||||
```ts
|
||||
await postModuleService.deletePosts("123")
|
||||
```
|
||||
|
||||
To delete one record, pass its ID as a parameter of the method.
|
||||
|
||||
---
|
||||
|
||||
## Delete Multiple Records
|
||||
|
||||
```ts
|
||||
await postModuleService.deletePosts([
|
||||
"123",
|
||||
"321"
|
||||
])
|
||||
```
|
||||
|
||||
To delete multiple records, pass an array of IDs as a parameter of the method.
|
||||
|
||||
---
|
||||
|
||||
## Delete Records Matching Filters
|
||||
|
||||
```ts
|
||||
await postModuleService.deletePosts({
|
||||
name: "My Post"
|
||||
})
|
||||
```
|
||||
|
||||
To delete records matching a set of filters, pass an object of filters as a parameter.
|
||||
|
||||
<Note>
|
||||
|
||||
Learn more about accepted filters in [this documentation](../../tips/filtering/page.mdx).
|
||||
|
||||
</Note>
|
||||
Reference in New Issue
Block a user