getting organizations from the backend
This commit is contained in:
28
server/db/model/edges/MEMBER_IN_NETWORK.js
Normal file
28
server/db/model/edges/MEMBER_IN_NETWORK.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export default class MEMBER_IN_NETWORK {
|
||||
prefix = "MEMBER_IN_NETWORK"
|
||||
indices = null
|
||||
|
||||
constructor(indices) {
|
||||
this.indices = indices
|
||||
}
|
||||
|
||||
schema = z.object({
|
||||
id: z.number(),
|
||||
from: z.string(),
|
||||
to: z.string(),
|
||||
created: z.string()
|
||||
})
|
||||
.strict()
|
||||
|
||||
getByFrom(fromID) {
|
||||
let result = []
|
||||
for(let i = this.indices[0]; i < this.indices[1]; i++) {
|
||||
if(global.db.edges[i].from === fromID) {
|
||||
result.push(global.db.edges[i])
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export default class MemberInNetwork {
|
||||
schema = z.object({
|
||||
id: z.number(),
|
||||
from: z.string(),
|
||||
to: z.string(),
|
||||
created: z.string()
|
||||
})
|
||||
.strict()
|
||||
|
||||
indices = null
|
||||
|
||||
constructor(indices) {
|
||||
this.indices = indices
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user