mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: marshal convertLicenses() into a [] instead of nil (#22366)
This was a bad smell that was being addressed by the frontend. This type was generating out to be a `nil`/`null` instead of an empty `License[]`. Now this returns as an empty array and we can actively check if we have no licenses with a length of `0`.
This commit is contained in:
@@ -349,7 +349,7 @@ func convertLicense(dl database.License, c jwt.MapClaims) codersdk.License {
|
||||
}
|
||||
|
||||
func convertLicenses(licenses []database.License) ([]codersdk.License, error) {
|
||||
var out []codersdk.License
|
||||
out := make([]codersdk.License, 0, len(licenses))
|
||||
for _, l := range licenses {
|
||||
c, err := decodeClaims(l)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user