correct Search
This commit is contained in:
@@ -2,6 +2,7 @@ package infrastructure
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"slices"
|
||||
|
||||
oclib "cloud.o-forge.io/core/oc-lib"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
@@ -51,7 +52,10 @@ func EmitNATS(user string, message tools.PropalgationMessage) {
|
||||
|
||||
func ListenNATS() {
|
||||
tools.NewNATSCaller().ListenNats(map[tools.NATSMethod]func(tools.NATSResponse){
|
||||
tools.CATALOG_SEARCH_EVENT: func(resp tools.NATSResponse) {
|
||||
tools.SEARCH_EVENT: func(resp tools.NATSResponse) {
|
||||
if !slices.Contains(ressourceCols, oclib.LibDataEnum(resp.Datatype)) {
|
||||
return
|
||||
}
|
||||
p, err := resources.ToResource(int(resp.Datatype), resp.Payload)
|
||||
if err == nil {
|
||||
SearchStream[resp.User] <- p // TODO when do we update it in our catalog ?
|
||||
|
||||
Reference in New Issue
Block a user