working on showing single posts for users we dont know about

This commit is contained in:
2025-12-31 07:11:35 +00:00
parent ed9dfb990f
commit 63643f0f9a
17 changed files with 127 additions and 74 deletions

View File

@@ -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);