forked from Simnation/Main
ed
This commit is contained in:
parent
9e03784b6e
commit
53578d1af6
32 changed files with 1857 additions and 0 deletions
18
resources/[tools]/um-idcard/web/js/fetchNui.js
Normal file
18
resources/[tools]/um-idcard/web/js/fetchNui.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
const resource = GetParentResourceName();
|
||||
|
||||
export async function fetchNui(eventName, data) {
|
||||
try {
|
||||
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();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue