From 6567dc68a566a6db22059c59d5cbf0d14d347479 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 19 Nov 2024 15:07:47 +0100 Subject: [PATCH] Working update --- controllers/collaborative_area.go | 13 +++++-------- go.mod | 2 +- go.sum | 12 ++++++++++++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/controllers/collaborative_area.go b/controllers/collaborative_area.go index a284b8b..f9f8e75 100644 --- a/controllers/collaborative_area.go +++ b/controllers/collaborative_area.go @@ -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() } diff --git a/go.mod b/go.mod index 134f2c2..a1d8e7f 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.0 toolchain go1.22.4 require ( - cloud.o-forge.io/core/oc-lib v0.0.0-20241114090218-14fe694fd370 + cloud.o-forge.io/core/oc-lib v0.0.0-20241119132823-94803f820af1 github.com/beego/beego/v2 v2.3.1 ) diff --git a/go.sum b/go.sum index e22754e..996e71c 100644 --- a/go.sum +++ b/go.sum @@ -26,6 +26,18 @@ cloud.o-forge.io/core/oc-lib v0.0.0-20241108104423-7fd44a55cb28 h1:jekSPkD/b59kJ cloud.o-forge.io/core/oc-lib v0.0.0-20241108104423-7fd44a55cb28/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= cloud.o-forge.io/core/oc-lib v0.0.0-20241114090218-14fe694fd370 h1:3o0naAyt9oXs/dG4eygreVePBmjd516PEZrW9aviJ0Q= cloud.o-forge.io/core/oc-lib v0.0.0-20241114090218-14fe694fd370/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119090846-3b8079ca87ad h1:4TEFD4QpSIO0hJsQ4Erj/cSelXvuSmxe19i/gYtil5o= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119090846-3b8079ca87ad/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119110114-603641a589f3 h1:dRVc/Kg1ubNL6SVBMC/GFUS4+ihfe3gw/JcmfjOb0/w= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119110114-603641a589f3/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119122801-aab0d54dfa2b h1:M1ml1CMgjbscRNx36KrbGOIXWMka7freUqGlL2vYntA= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119122801-aab0d54dfa2b/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119124114-cfcad2343de7 h1:fao48ZRWAPagD6SeFfmct9KaOUYJUvgDhdGAYMcQUWw= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119124114-cfcad2343de7/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119130341-898700d127b5 h1:eMY6tisbBCRq42rBDhiDoXjlQmbMc/kF0z5yZRASu7M= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119130341-898700d127b5/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119132823-94803f820af1 h1:c/gsB3C14u3f8PetaN24+lDfp/Bc1zL8UUj6kE0TWrQ= +cloud.o-forge.io/core/oc-lib v0.0.0-20241119132823-94803f820af1/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/beego/beego/v2 v2.3.0 h1:iECVwzm6egw6iw6tkWrEDqXG4NQtKLQ6QBSYqlM6T/I= github.com/beego/beego/v2 v2.3.0/go.mod h1:Ob/5BJ9fIKZLd4s9ZV3o9J6odkkIyL83et+p98gyYXo=