This commit is contained in:
Ren Amamiya
2023-03-24 14:59:01 +07:00
parent e2fa8cbe03
commit c1f06f8b28
29 changed files with 179 additions and 229 deletions

View File

@@ -86,6 +86,12 @@ export async function getCacheProfile(id) {
return result[0];
}
// get note by id
export async function getAllNotes() {
const db = await connect();
return await db.select(`SELECT * FROM cache_notes WHERE is_root = 0 ORDER BY created_at DESC LIMIT 1000`);
}
// get note by id
export async function getNoteByID(id) {
const db = await connect();

View File

@@ -1,8 +0,0 @@
export const tagsToArray = (arr) => {
const newarr = [];
// push item to newarr
arr.forEach((item) => {
newarr.push(item[1]);
});
return newarr;
};

17
src/utils/transform.tsx Normal file
View File

@@ -0,0 +1,17 @@
export const tagsToArray = (arr) => {
const newarr = [];
// push item to newarr
arr.forEach((item) => {
newarr.push(item[1]);
});
return newarr;
};
export const pubkeyArray = (arr) => {
const newarr = [];
// push item to newarr
arr.forEach((item) => {
newarr.push(item.pubkey);
});
return newarr;
};