add groups
This commit is contained in:
@@ -24,7 +24,7 @@ var comp_dt = tools.COMPUTE_RESOURCE
|
||||
// @Success 200 {compute} models.compute
|
||||
// @router /:id [put]
|
||||
func (o *ComputeController) Put() {
|
||||
user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
user, _, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
// store and return Id or post with UUID
|
||||
var res map[string]interface{}
|
||||
id := o.Ctx.Input.Param(":id")
|
||||
@@ -32,7 +32,7 @@ func (o *ComputeController) Put() {
|
||||
data := oclib.NewRequestAdmin(comp_collection, nil).UpdateOne(res, id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -54,7 +54,7 @@ func (o *ComputeController) Post() {
|
||||
data := oclib.NewRequest(comp_collection, user, peerID, groups, nil).StoreOne(res)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -113,7 +113,7 @@ func (o *ComputeController) Delete() {
|
||||
data := oclib.NewRequest(comp_collection, user, peerID, groups, nil).DeleteOne(id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_DELETE,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
|
||||
Reference in New Issue
Block a user