14 lines
326 B
JavaScript
14 lines
326 B
JavaScript
const resource = GetParentResourceName();
|
|
|
|
export async function fetchNui(eventName, data) {
|
|
const resp = await fetch(`https://${resource}/${eventName}`, {
|
|
method: 'post',
|
|
headers: {
|
|
'Content-Type': 'application/json; charset=UTF-8',
|
|
},
|
|
body: JSON.stringify(data),
|
|
});
|
|
|
|
return await resp.json();
|
|
}
|