working with db, docker working, small error with personal data
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user