feat(js): add app-http contracts and migrate helpdesk runtime layer
This commit is contained in:
@@ -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 = '') => {
|
||||
|
||||
Reference in New Issue
Block a user