mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-16 21:46:03 +01:00
10 lines
321 B
JavaScript
10 lines
321 B
JavaScript
export function fetchCallback(name, data, cb) {
|
|
fetch(`https://${GetParentResourceName()}/${name}`, {
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json; charset=UTF-8" },
|
|
body: JSON.stringify(data)
|
|
}).then(resp => resp.json()).then(resp => {
|
|
if (cb) cb(resp);
|
|
});
|
|
}
|