Skip to content

Commit

Permalink
force un tableau de longueur 0 pour les labels. (#178)
Browse files Browse the repository at this point in the history
* force un tableau de longueur 0 pour les labels.

* préférer la vérification de non-nil au moment de la création de l'objet

---------

Co-authored-by: Christophe Ninucci <[email protected]>
  • Loading branch information
chrnin and Christophe Ninucci authored Jun 9, 2023
1 parent ab6510c commit 01b9d94
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/wekan/createCard.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package wekan

import (
"context"

"github.com/jackc/pgx/v5/pgxpool"
"github.com/signaux-faibles/libwekan"
"github.com/spf13/viper"
Expand All @@ -29,6 +28,7 @@ func (service wekanService) CreateCard(ctx context.Context, params core.KanbanNe
if err != nil {
return err
}

card, err := buildCard(board, list.ID, swimlane.ID, params.Description, params.Siret, user, etablissement, params.Labels)
if err != nil {
return err
Expand Down Expand Up @@ -59,8 +59,9 @@ func buildCard(
card.CustomFields = []libwekan.CardCustomField{activiteField, effectifField, contactField, siretField, ficheField}

labelIDs := utils.Convert(labels, labelNameToIDConvertor(configBoard))
card.LabelIDs = labelIDs

if labelIDs != nil {
card.LabelIDs = labelIDs
}
return card, nil
}

Expand Down

0 comments on commit 01b9d94

Please sign in to comment.