(ctx context.Context, input types.CreateCollectionReq)
| 150 | } |
| 151 | |
| 152 | func (cc *CollectionComponent) UpdateCollection(ctx context.Context, input types.CreateCollectionReq) (*database.Collection, error) { |
| 153 | collection, err := cc.cs.GetCollection(ctx, input.ID) |
| 154 | if err != nil { |
| 155 | return nil, fmt.Errorf("cannot find collection to update, %w", err) |
| 156 | } |
| 157 | collection.Name = input.Name |
| 158 | collection.Nickname = input.Nickname |
| 159 | collection.Description = input.Description |
| 160 | collection.Private = input.Private |
| 161 | collection.Theme = input.Theme |
| 162 | collection.UpdatedAt = time.Now() |
| 163 | return cc.cs.UpdateCollection(ctx, *collection) |
| 164 | } |
| 165 | |
| 166 | func (cc *CollectionComponent) DeleteCollection(ctx context.Context, id int64, userName string) error { |
| 167 | // find by user name |
nothing calls this directly
no test coverage detected