[CHANGE] To async

This commit is contained in:
Peter Pfeufer 2025-08-09 10:36:22 +02:00
parent 4cc108ab7f
commit c1cd7ca64f
No known key found for this signature in database

View File

@ -160,12 +160,12 @@ const _fetchAjaxData = async ({
* @param {boolean} responseIsJson Whether the response is expected to be JSON or not (default: true) * @param {boolean} responseIsJson Whether the response is expected to be JSON or not (default: true)
* @return {Promise<string>} The fetched data * @return {Promise<string>} The fetched data
*/ */
const fetchGet = ({ const fetchGet = async ({
url, url,
payload = null, payload = null,
responseIsJson = true responseIsJson = true
}) => { }) => {
return _fetchAjaxData({ return await _fetchAjaxData({
url: url, url: url,
method: 'get', method: 'get',
payload: payload, payload: payload,
@ -203,13 +203,13 @@ const fetchGet = ({
* @param {boolean} responseIsJson Whether the response is expected to be JSON or not (default: true) * @param {boolean} responseIsJson Whether the response is expected to be JSON or not (default: true)
* @return {Promise<string>} The fetched data * @return {Promise<string>} The fetched data
*/ */
const fetchPost = ({ const fetchPost = async ({
url, url,
csrfToken, csrfToken,
payload = null, payload = null,
responseIsJson = true responseIsJson = true
}) => { }) => {
return _fetchAjaxData({ return await _fetchAjaxData({
url: url, url: url,
method: 'post', method: 'post',
csrfToken: csrfToken, csrfToken: csrfToken,