CRUD operations for Posts
- added all CRUD operations for Post model - add() also creates POST_BY_MEMBER and POST_FROM_NETWORK edges - delete() also deletes associated edges - delete() currently does not reallocate node/edge indices after deleting - will write the data to the db.json file and global.db.nodes
This commit is contained in:
@@ -6,6 +6,8 @@ import Post from "./forum/post.js"
|
||||
import Conversation from "./dms/conversation.js"
|
||||
import DM from "./dms/dm.js"
|
||||
import MEMBER_IN_NETWORK from "./edges/MEMBER_IN_NETWORK.js"
|
||||
import POST_FROM_NETWORK from "./edges/POST_FROM_NETWORK.js"
|
||||
import POST_BY_MEMBER from "./edges/POST_BY_MEMBER.js"
|
||||
|
||||
let nIndices = {
|
||||
"MEMBER" : [0, 0], // [id, startIndex, nextEmptyIndex
|
||||
@@ -18,7 +20,9 @@ let nIndices = {
|
||||
}
|
||||
|
||||
let eIndices = {
|
||||
"MEMBER_IN_NETWORK": [0, 0]
|
||||
"MEMBER_IN_NETWORK": [0, 0],
|
||||
"POST_FROM_NETWORK": [4000, 4000],
|
||||
"POST_BY_MEMBER": [7000, 7000]
|
||||
}
|
||||
|
||||
export let nodeModels = {
|
||||
@@ -32,5 +36,7 @@ export let nodeModels = {
|
||||
}
|
||||
|
||||
export let edgeModels = {
|
||||
MEMBER_IN_NETWORK: new MEMBER_IN_NETWORK(eIndices.MEMBER_IN_NETWORK)
|
||||
MEMBER_IN_NETWORK: new MEMBER_IN_NETWORK(eIndices.MEMBER_IN_NETWORK),
|
||||
POST_FROM_NETWORK: new POST_FROM_NETWORK(eIndices.POST_FROM_NETWORK),
|
||||
POST_BY_MEMBER: new POST_BY_MEMBER(eIndices.POST_BY_MEMBER)
|
||||
}
|
||||
Reference in New Issue
Block a user