mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
working updates
This commit is contained in:
1 parent
18be1a7d0f
commit
ce951ceecc
10 files changed
+92
-53
No files matched your search
@@ -33,14 +33,12 @@ on(`__cfx_nui:${events.NOTE_DELETE_NOTE}`, (data: any) => {
|
||||
|
||||
|
||||
// coming soon tm
|
||||
|
||||
/*RegisterNuiCallbackType(events.NOTE_UPDATE_NOTE);
|
||||
RegisterNuiCallbackType(events.NOTE_UPDATE_NOTE);
|
||||
on(`__cfx_nui:${events.NOTE_UPDATE_NOTE}`, (data: any) => {
|
||||
const note = data;
|
||||
emitNet(events.NOTE_UPDATE_NOTE, note)
|
||||
})
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
emitNet(events.NOTE_FETCH_ALL_NOTES)
|
||||
}, 500);
|
||||
})*/
|
||||
onNet(events.NOTE_UPDATE_NOTE_SUCCESS, () => {
|
||||
emitNet(events.NOTE_FETCH_ALL_NOTES)
|
||||
});
|
||||
@@ -1 +1,44 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="%PUBLIC_URL%/favicon.ico"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>React App</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="main.js"></script></body></html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Web site created using create-react-app"
|
||||
/>
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
|
||||
<!--
|
||||
Notice the use of in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "/favicon.ico" will
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
<script src="dev.js"></script></body>
|
||||
</html>
|
||||
Binary file not shown.
@@ -58,7 +58,7 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXIST npwd_notes (
|
||||
CREATE TABLE IF NOT EXISTS npwd_notes (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
identifier varchar(255) NOT NULL,
|
||||
title varchar(255) NOT NULL,
|
||||
|
||||
@@ -4,6 +4,7 @@ import { pool } from './db';
|
||||
import { useIdentifier } from './functions';
|
||||
|
||||
interface Note {
|
||||
id?: number;
|
||||
title: string;
|
||||
content: string;
|
||||
}
|
||||
@@ -12,12 +13,6 @@ interface NoteId {
|
||||
id: number
|
||||
}
|
||||
|
||||
interface UpdateNote {
|
||||
id: number;
|
||||
title: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
async function addNote(identifier: string, note: Note): Promise<any> {
|
||||
const query = "INSERT INTO npwd_notes (identifier, title, content) VALUES (?, ?, ?)"
|
||||
await pool.query(query,
|
||||
@@ -41,7 +36,7 @@ async function deleteNote(noteId: number, identifier: string) {
|
||||
await pool.query(query, [noteId, identifier])
|
||||
}
|
||||
|
||||
/*async function updateNote(note: UpdateNote, identifier: string): Promise<any> {
|
||||
async function updateNote(note: Note, identifier: string): Promise<any> {
|
||||
const query = "UPDATE npwd_notes SET title = ?, content = ? WHERE id = ? AND identifier = ?"
|
||||
await pool.query(query, [
|
||||
note.title,
|
||||
@@ -49,7 +44,7 @@ async function deleteNote(noteId: number, identifier: string) {
|
||||
note.id,
|
||||
identifier
|
||||
])
|
||||
}*/
|
||||
}
|
||||
|
||||
onNet(events.NOTE_ADD_NOTE, async (note: Note) => {
|
||||
try {
|
||||
@@ -84,13 +79,13 @@ onNet(events.NOTE_DELETE_NOTE, async (noteId: NoteId) => {
|
||||
}
|
||||
})
|
||||
|
||||
// coming soon tm
|
||||
|
||||
/*onNet(events.NOTE_UPDATE_NOTE, async (note: UpdateNote) => {
|
||||
onNet(events.NOTE_UPDATE_NOTE, async (note: Note) => {
|
||||
const _source = (global as any).source;
|
||||
try {
|
||||
const _identifier = await useIdentifier();
|
||||
updateNote(note, _identifier)
|
||||
emitNet(events.NOTE_UPDATE_NOTE_SUCCESS, _source)
|
||||
} catch (error) {
|
||||
console.log("NOTE ERROR:", error)
|
||||
emitNet(events.NOTE_UPDATE_NOTE_FAILURE, _source)
|
||||
}
|
||||
})*/
|
||||
})
|
||||
@@ -52,5 +52,7 @@ export default {
|
||||
NOTE_FETCH_ALL_NOTES: 'phone:fetchAllNotes',
|
||||
NOTE_SEND_NOTE: 'phone:sendNote',
|
||||
NOTE_DELETE_NOTE: 'phone:deleteNote',
|
||||
NOTE_UPDATE_NOTE: 'phone:updateNote'
|
||||
NOTE_UPDATE_NOTE: 'phone:updateNote',
|
||||
NOTE_UPDATE_NOTE_SUCCESS: 'phone:updateNoteSuccess',
|
||||
NOTE_UPDATE_NOTE_FAILURE: 'phone:updateNoteFailure'
|
||||
}
|
||||
Reference in new issue
Block a user