- fixed problem with empty project;

This commit is contained in:
naudachu 2023-12-03 17:02:47 +05:00
parent 696d0f2233
commit 40fcb5896a
2 changed files with 5 additions and 11 deletions

View File

@ -23,17 +23,7 @@ import (
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
) )
<<<<<<< HEAD
const (
envfile = "prod.env"
migrationfile = "../internal/storage/migrate"
// production env:
// envfile = "../docker/prod.env"
// migrationfile = "../internal/storage/migrate"
)
=======
const migrationfile = "../internal/storage/migrate" const migrationfile = "../internal/storage/migrate"
>>>>>>> dev
func main() { func main() {
log.Print("started") log.Print("started")

View File

@ -2,6 +2,7 @@ package controller
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"ticket-pimp/internal/domain" "ticket-pimp/internal/domain"
) )
@ -13,6 +14,10 @@ func (wc *WorkflowController) CreateCoda(guildID string, chanID string) (string,
return "", err return "", err
} }
if p == nil {
return "", errors.New("project wasn't found in the db")
}
requestResult, err := wc.ICoda.CreateApp(domain.CodaApplication{ requestResult, err := wc.ICoda.CreateApp(domain.CodaApplication{
ID: p.Key, ID: p.Key,
Summary: p.Name, Summary: p.Name,
@ -23,5 +28,4 @@ func (wc *WorkflowController) CreateCoda(guildID string, chanID string) (string,
}) })
return requestResult, err return requestResult, err
} }