feat(js): add app-http contracts and migrate helpdesk runtime layer

This commit is contained in:
2026-04-20 22:31:13 +02:00
parent ec2f03e0cf
commit f189ef9df6
34 changed files with 2023 additions and 1134 deletions

View File

@@ -1,3 +1,5 @@
import { postForm as postFormRequest } from '../core/app-http.js';
export const buildUrl = (appBase, path) => new URL(path, appBase).toString();
export const getAppBase = () => {
@@ -125,15 +127,7 @@ export const buildBadgeList = (items, options = {}) => {
export const postAction = async (url, csrf, data = {}) => {
const body = new URLSearchParams({ ...data, [csrf.key]: csrf.token });
return fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'X-Requested-With': 'fetch'
},
body
});
return postFormRequest(url, body);
};
export const badgeHtml = (gridjs, value = '') => {