| 430 | } |
| 431 | |
| 432 | func SetColor(workspaceId string, color string) error { |
| 433 | ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) |
| 434 | defer cancel() |
| 435 | ws, e := wstore.DBGet[*waveobj.Workspace](ctx, workspaceId) |
| 436 | if e != nil { |
| 437 | return e |
| 438 | } |
| 439 | if ws == nil { |
| 440 | return fmt.Errorf("workspace not found: %q", workspaceId) |
| 441 | } |
| 442 | ws.Color = color |
| 443 | wstore.DBUpdate(ctx, ws) |
| 444 | return nil |
| 445 | } |
| 446 | |
| 447 | func SetName(workspaceId string, name string) error { |
| 448 | ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) |