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:
Shahed Nasser
2024-07-26 14:40:56 +00:00
committed by GitHub
parent 71411463b1
commit a4eab3f37a
14 changed files with 1131 additions and 2 deletions
@@ -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>