mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-07 07:42:45 +01:00
@@ -20,11 +20,13 @@ func (db *Database) RelatedCreate(ctx context.Context, id, id2 int64) error {
|
||||
From: driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id))),
|
||||
To: driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id2))),
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (db *Database) RelatedBatchCreate(ctx context.Context, edges []*driver.EdgeDocument) error {
|
||||
_, err := db.relatedCollection.CreateEdges(ctx, edges)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -33,7 +35,7 @@ func (db *Database) RelatedRemove(ctx context.Context, id, id2 int64) error {
|
||||
FOR d in @@collection
|
||||
FILTER (d._from == @id && d._to == @id2) || (d._to == @id && d._from == @id2)
|
||||
REMOVE d in @@collection`
|
||||
_, _, err := db.Query(ctx, q, map[string]interface{}{
|
||||
_, _, err := db.Query(ctx, q, map[string]any{
|
||||
"@collection": RelatedTicketsCollectionName,
|
||||
"id": driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id))),
|
||||
"id2": driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id2))),
|
||||
@@ -44,5 +46,6 @@ func (db *Database) RelatedRemove(ctx context.Context, id, id2 int64) error {
|
||||
driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id2))),
|
||||
},
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user