working on showing single posts for users we dont know about
This commit is contained in:
12
static/db.js
12
static/db.js
@@ -260,6 +260,18 @@ export async function mergeDataArray(userID, array) {
|
||||
}
|
||||
}
|
||||
export async function getPostForUser(userID, postID) {
|
||||
const { store } = await getDBTransactionStore(userID);
|
||||
const index = store.index("postIDIndex");
|
||||
return new Promise((resolve, reject) => {
|
||||
const getPostRequest = index.get(postID);
|
||||
getPostRequest.onsuccess = () => {
|
||||
resolve(getPostRequest.result);
|
||||
};
|
||||
getPostRequest.onerror = () => {
|
||||
console.error('Transaction failed:', getPostRequest.error?.message);
|
||||
reject(getPostRequest.error);
|
||||
};
|
||||
});
|
||||
}
|
||||
export async function getData(userID, lowerID, upperID) {
|
||||
const { store } = await getDBTransactionStore(userID);
|
||||
|
||||
Reference in New Issue
Block a user