@@ -8,12 +8,13 @@ import (
88 "github.com/satisfactorymodding/smr-api/generated"
99)
1010
11- func (r * mutationResolver ) CreateTag (ctx context.Context , tagName string ) (* generated.Tag , error ) {
11+ func (r * mutationResolver ) CreateTag (ctx context.Context , tagName string , description string ) (* generated.Tag , error ) {
1212 wrapper , newCtx := WrapMutationTrace (ctx , "createTag" )
1313 defer wrapper .end ()
1414
1515 dbTag := & postgres.Tag {
16- Name : tagName ,
16+ Name : tagName ,
17+ Description : description ,
1718 }
1819
1920 resultTag , err := postgres .CreateTag (newCtx , dbTag , true )
@@ -23,15 +24,16 @@ func (r *mutationResolver) CreateTag(ctx context.Context, tagName string) (*gene
2324 return DBTagToGenerated (resultTag ), nil
2425}
2526
26- func (r * mutationResolver ) CreateMultipleTags (ctx context.Context , tagNames []string ) ([]* generated.Tag , error ) {
27+ func (r * mutationResolver ) CreateMultipleTags (ctx context.Context , tags []* generated. NewTag ) ([]* generated.Tag , error ) {
2728 wrapper , newCtx := WrapMutationTrace (ctx , "createMultipleTags" )
2829 defer wrapper .end ()
2930
30- resultTags := make ([]postgres.Tag , len (tagNames ))
31+ resultTags := make ([]postgres.Tag , len (tags ))
3132
32- for i , tagName := range tagNames {
33+ for i , tag := range tags {
3334 dbTag := & postgres.Tag {
34- Name : tagName ,
35+ Name : tag .Name ,
36+ Description : tag .Description ,
3537 }
3638
3739 resultTag , err := postgres .CreateTag (newCtx , dbTag , false )
@@ -60,7 +62,7 @@ func (r *mutationResolver) DeleteTag(ctx context.Context, id string) (bool, erro
6062 return true , nil
6163}
6264
63- func (r * mutationResolver ) UpdateTag (ctx context.Context , id string , newName string ) (* generated.Tag , error ) {
65+ func (r * mutationResolver ) UpdateTag (ctx context.Context , id string , newName string , description string ) (* generated.Tag , error ) {
6466 wrapper , newCtx := WrapMutationTrace (ctx , "updateTag" )
6567 defer wrapper .end ()
6668
@@ -76,6 +78,7 @@ func (r *mutationResolver) UpdateTag(ctx context.Context, id string, newName str
7678 }
7779
7880 SetStringINNOE (& newName , & dbTag .Name )
81+ SetStringINNOE (& description , & dbTag .Description )
7982
8083 postgres .Save (newCtx , & dbTag )
8184
0 commit comments