working with db, docker working, small error with personal data

This commit is contained in:
metacryst
2026-03-10 19:09:47 -05:00
parent 4d2c515b7d
commit 7cfcc01c99
25 changed files with 337 additions and 469 deletions

View File

@@ -41,6 +41,7 @@ export default class Post {
if (by === "member" && authorId) {
result = this.getByMember(authorId)
} else { // network
console.warn("post.js 44: This call to global.db needs to be awaited")
let { id: networkId } = global.db.networks.getByAbbreviation(forum)
result = this.getByNetwork(networkId)
}
@@ -82,6 +83,7 @@ export default class Post {
async edit(id, text, userEmail) {
try {
console.warn("post.js 86: This call to global.db needs to be awaited")
let userId = global.db.members.getByEmail(userEmail).id
let postToEdit = this.getByID(id)
@@ -105,7 +107,9 @@ export default class Post {
async delete(id, forum, userEmail) {
try {
console.warn("post.js 110: This call to global.db needs to be awaited")
let userId = global.db.members.getByEmail(userEmail).id
console.warn("post.js 110: This call to global.db needs to be awaited")
let network = global.db.networks.getByAbbreviation(forum)
if (this.getAuthor(id) !== userId) {
@@ -134,7 +138,9 @@ export default class Post {
async add(text, forum, userEmail) {
let newPost = {}
console.warn("post.js 141: This call to global.db needs to be awaited")
let sender = global.db.members.getByEmail(userEmail)
console.warn("post.js 143: This call to global.db needs to be awaited")
let network = global.db.networks.getByAbbreviation(forum)
newPost.text = text