Skip to content

Commit

Permalink
Fixed readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ozziest committed Sep 28, 2024
1 parent d948a6f commit f6aaea0
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

You can send insert, update, delete, and fetch data from Axe API servers without pain. `axe-api-client` has advanced query support with the active record pattern.

## Config
## ⚙️ Config

```ts
import { api, IRequest } from "axe-api-client";
Expand All @@ -47,7 +47,7 @@ api.interceptors.addResponse((response: Response) => {
});
```

## Insert
## Insert

```js
const response = await api.resource("users").insert({
Expand All @@ -56,7 +56,7 @@ const response = await api.resource("users").insert({
});
```

## Post
## 📤 Post

```js
const response = await api.resource("users").post({
Expand All @@ -65,7 +65,7 @@ const response = await api.resource("users").post({
});
```

## Update
## 🔄 Update

```js
const response = await api.resource("users").update({
Expand All @@ -74,7 +74,7 @@ const response = await api.resource("users").update({
});
```

## Patch
## 🩹 Patch

```js
const response = await api.resource("users").patch({
Expand All @@ -83,7 +83,7 @@ const response = await api.resource("users").patch({
});
```

## Put
## ✏️ Put

```js
const response = await api.resource("users").put({
Expand All @@ -92,21 +92,21 @@ const response = await api.resource("users").put({
});
```

## Delete
## 🗑️ Delete

```js
const response = await api.resource("users").delete();
```

## Query
## 🔍 Query

```js
import { api } from "axe-api-client";

const data = await api.resource("users").paginate();
```

## Fields
## 📝 Fields

```js
const response = await api
Expand All @@ -115,7 +115,7 @@ const response = await api
.paginate();
```

## Sorting
## 🧩 Sorting

```js
const response = await api
Expand All @@ -127,19 +127,19 @@ const response = await api
.paginate();
```

## Limits
## 🚦 Limits

```js
const response = await api.resource("users").paginate({ page: 1, perPage: 25 });
```

## First
## First

```js
const response = await api.resource("users").first();
```

## Where Conditions
## Where Conditions

```js
const response = await api.resource("users").where("age", 18).paginate();
Expand Down Expand Up @@ -188,7 +188,7 @@ const response = await api

> All the [operators](https://axe-api.com/basics/queries/index.html#operators) should be able to used.
## Related Data
## 🔗 Related Data

```js
const response = await api
Expand All @@ -197,7 +197,7 @@ const response = await api
.paginate();
```

## Quick where functions
## Quick where functions

We can use the following query where functions:

Expand All @@ -211,6 +211,14 @@ We can use the following query where functions:
- `whereNull("age")`
- `whereNotNull("age")`

## License
## 👥 Contributors

<a href="https://github.com/axe-api/client/graphs/contributors">
<img src="https://contrib.rocks/image?repo=axe-api/client" />
</a>

Made with [contrib.rocks](https://contrib.rocks).

## 📜 License

[MIT License](LICENSE)

0 comments on commit f6aaea0

Please sign in to comment.