Working update
This commit is contained in:
@@ -97,7 +97,7 @@ func (o *CollaborativeAreaController) Get() {
|
||||
o.ServeJSON()
|
||||
}
|
||||
|
||||
// @Title Add Workspace
|
||||
// @Title Remove Workspace
|
||||
// @Description find shared workspace by id
|
||||
// @Param id path string true "the id you want to get"
|
||||
// @Param id2 path string true "the id you want to add"
|
||||
@@ -135,17 +135,14 @@ func (o *CollaborativeAreaController) RemoveWorkflow() {
|
||||
id := o.Ctx.Input.Param(":id")
|
||||
id2 := o.Ctx.Input.Param(":id2")
|
||||
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||
fmt.Println("RemoveWorkflow", r)
|
||||
shared := r.ToCollaborativeArea()
|
||||
newWorkflows := []string{}
|
||||
if slices.Contains(shared.Workflows, id2) {
|
||||
for _, w := range shared.Workflows {
|
||||
if w != id2 {
|
||||
newWorkflows = append(newWorkflows, w)
|
||||
}
|
||||
for _, w := range shared.Workflows {
|
||||
if w != id2 {
|
||||
newWorkflows = append(newWorkflows, w)
|
||||
}
|
||||
shared.Workflows = newWorkflows
|
||||
}
|
||||
shared.Workflows = newWorkflows
|
||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
||||
o.ServeJSON()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user