FUCK!!!
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
17
src/utils/transform.tsx
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user