Fix uuidShort to handle real UUIDs now that we have them

This commit is contained in:
Eli Ribble 2026-01-07 14:25:40 +00:00
parent 9435af6a1f
commit 98416a025d

View file

@ -943,12 +943,13 @@ func breedingSourcesByCell(ctx context.Context, org *models.Organization, c h3.C
return results, nil return results, nil
} }
func uuidShort(uuid string) string { func uuidShort(uuid uuid.UUID) string {
if len(uuid) < 7 { s := uuid.String()
return uuid // Return as is if too short if len(s) < 7 {
return s // Return as is if too short
} }
return uuid[:3] + "..." + uuid[len(uuid)-4:] return s[:3] + "..." + s[len(s)-4:]
} }
func sourceByGlobalId(ctx context.Context, org *models.Organization, id uuid.UUID) (*BreedingSourceDetail, error) { func sourceByGlobalId(ctx context.Context, org *models.Organization, id uuid.UUID) (*BreedingSourceDetail, error) {