From 4a5ca60c7085bd59577f254ec8cf35121d33f48b Mon Sep 17 00:00:00 2001 From: fiftin Date: Sun, 10 Mar 2024 23:06:17 +0100 Subject: [PATCH] feat: create none inventory by default --- api/projects/projects.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/api/projects/projects.go b/api/projects/projects.go index 5e91ce40a..63d232758 100644 --- a/api/projects/projects.go +++ b/api/projects/projects.go @@ -1,10 +1,10 @@ package projects import ( - log "github.com/sirupsen/logrus" "github.com/ansible-semaphore/semaphore/api/helpers" "github.com/ansible-semaphore/semaphore/db" "github.com/ansible-semaphore/semaphore/util" + log "github.com/sirupsen/logrus" "net/http" "github.com/gorilla/context" @@ -223,6 +223,17 @@ func AddProject(w http.ResponseWriter, r *http.Request) { return } + _, err = store.CreateInventory(db.Inventory{ + Name: "None", + ProjectID: body.ID, + Type: "none", + }) + + if err != nil { + helpers.WriteError(w, err) + return + } + if bodyWithDemo.Demo { err = createDemoProject(body.ID, store)