Skip to content

Commit

Permalink
feat: create none inventory by default
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Mar 10, 2024
1 parent 4c8312b commit 4a5ca60
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion api/projects/projects.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 4a5ca60

Please sign in to comment.