This commit is contained in:
Ren Amamiya
2023-03-22 11:02:56 +07:00
parent ca87624727
commit b687bd9893
3 changed files with 12 additions and 7 deletions

View File

@@ -18,13 +18,12 @@ import {
} from 'react';
export default function Page() {
const router = useRouter();
const { db }: any = useContext(DatabaseContext);
const id = router.query.id;
const [root, setRoot] = useState(null);
const router = useRouter();
const { id }: any = router.query;
const fetchRoot = useCallback(async () => {
const result = await db.select(`SELECT * FROM cache_notes WHERE id = "${id}"`);
setRoot(result[0]);