Skip to content

Commit

Permalink
chore: update collection languages
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Dec 3, 2023
1 parent 28edadd commit 41cf12d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/api/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,14 @@ func (a *Collection) Update(ctx *gear.Context) error {
return gear.ErrInternalServerError.From(err)
}
}
if input.Version != nil && (input.Context != nil || input.Info != nil) {
if input.Version != nil && (input.Context != nil || input.Info != nil || input.Languages != nil) {
infoInput := &bll.UpdateMessageInput{
ID: input.ID,
GID: input.GID,
Version: *input.Version,
Context: input.Context,
Language: input.Language,
ID: input.ID,
GID: input.GID,
Version: *input.Version,
Context: input.Context,
Language: input.Language,
Languages: input.Languages,
}
if input.Info != nil {
msg := bll.ArrayMessage{
Expand Down
1 change: 1 addition & 0 deletions src/bll/writing_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ type UpdateCollectionInput struct {
UpdatedAt int64 `json:"updated_at" cbor:"updated_at" validate:"gte=1"`
Version *uint16 `json:"version,omitempty" cbor:"version,omitempty" validate:"omitempty,gte=0,lte=32767"`
Language *string `json:"language,omitempty" cbor:"language,omitempty"`
Languages *[]string `json:"languages,omitempty" cbor:"languages,omitempty"`
Context *string `json:"context,omitempty" cbor:"context,omitempty" validate:"omitempty,gte=0,lte=1024"`
Info *CollectionInfo `json:"info,omitempty" cbor:"info,omitempty" validate:"omitempty,required"`
Cover *string `json:"cover,omitempty" cbor:"cover,omitempty" validate:"omitempty,http_url"`
Expand Down

0 comments on commit 41cf12d

Please sign in to comment.