mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
32 lines
718 B
TypeScript
32 lines
718 B
TypeScript
import events from '../utils/events';
|
|
|
|
onNet(events.NOTE_SEND_NOTE, (notes: any) => {
|
|
console.log(notes)
|
|
SendNuiMessage(
|
|
JSON.stringify({
|
|
app: "NOTES",
|
|
method: "setNotes",
|
|
data: notes
|
|
})
|
|
)
|
|
})
|
|
|
|
RegisterNuiCallbackType(events.NOTE_ADD_NOTE);
|
|
on(`__cfx_nui:${events.NOTE_ADD_NOTE}`, (data: any) => {
|
|
const note = data;
|
|
emitNet(events.NOTE_ADD_NOTE, note)
|
|
|
|
setTimeout(() => {
|
|
emitNet(events.NOTE_FETCH_ALL_NOTES)
|
|
}, 500);
|
|
})
|
|
|
|
RegisterNuiCallbackType(events.NOTE_DELETE_NOTE);
|
|
on(`__cfx_nui:${events.NOTE_DELETE_NOTE}`, (data: any) => {
|
|
const noteId = data;
|
|
emitNet(events.NOTE_DELETE_NOTE, noteId)
|
|
|
|
setTimeout(() => {
|
|
emitNet(events.NOTE_FETCH_ALL_NOTES)
|
|
}, 500);
|
|
}) |