mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-08-24 02:41:42 +02:00
[MISC] Formatting
This commit is contained in:
parent
0028310aa5
commit
4cc108ab7f
@ -9,7 +9,7 @@ The JS file is already loaded in the base template, so it is globally available.
|
|||||||
|
|
||||||
The following functions are available in the JavaScript framework:
|
The following functions are available in the JavaScript framework:
|
||||||
|
|
||||||
### `isArray()`
|
### isArray()
|
||||||
|
|
||||||
Checks if the given value is an array.
|
Checks if the given value is an array.
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ if (isArray(someVariable)) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### `isObject()`
|
### isObject()
|
||||||
|
|
||||||
Checks if the given value is an object.
|
Checks if the given value is an object.
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ if (isObject(someVariable)) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### `fetchGet()`
|
### fetchGet()
|
||||||
|
|
||||||
Performs a GET request to the given URL and returns a Promise that resolves with the response data.
|
Performs a GET request to the given URL and returns a Promise that resolves with the response data.
|
||||||
|
|
||||||
@ -62,13 +62,13 @@ fetchGet({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `fetchGet()` Parameters
|
#### fetchGet() Parameters
|
||||||
|
|
||||||
- `url`: The URL to fetch data from.
|
- `url`: The URL to fetch data from.
|
||||||
- `payload`: Optional data to send with the request. Can be an object or a string.
|
- `payload`: Optional data to send with the request. Can be an object or a string.
|
||||||
- `responseIsJson`: Optional boolean indicating if the response should be parsed as JSON (default is `true`).
|
- `responseIsJson`: Optional boolean indicating if the response should be parsed as JSON (default is `true`).
|
||||||
|
|
||||||
### `fetchPost()`
|
### fetchPost()
|
||||||
|
|
||||||
Performs a POST request to the given URL with the provided data and returns a Promise that resolves with the response data.
|
Performs a POST request to the given URL with the provided data and returns a Promise that resolves with the response data.
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ fetchPost({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `fetchPost()` Parameters
|
#### fetchPost() Parameters
|
||||||
|
|
||||||
- `url`: The URL to send the POST request to.
|
- `url`: The URL to send the POST request to.
|
||||||
- `csrfToken`: The CSRF token to include in the request headers.
|
- `csrfToken`: The CSRF token to include in the request headers.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user