🎨 Improve db tv relation render

This commit is contained in:
Daniel 2024-03-07 16:11:58 +08:00
parent 5bcfdcbf8c
commit 5700a9f18a
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 11 additions and 11 deletions

View file

@ -141,16 +141,16 @@ func (value *Value) String() string {
}
return ""
case KeyTypeRelation:
if 1 > len(value.Relation.Contents) {
if nil == value.Relation || 1 > len(value.Relation.Contents) {
return ""
}
var ret []string
for _, v := range value.Relation.Contents {
ret = append(ret, v)
ret = append(ret, v.String())
}
return strings.TrimSpace(strings.Join(ret, ", "))
case KeyTypeRollup:
if nil == value.Rollup || nil == value.Rollup.Contents {
if nil == value.Rollup || 1 > len(value.Rollup.Contents) {
return ""
}
var ret []string
@ -648,8 +648,8 @@ type ValueCheckbox struct {
}
type ValueRelation struct {
Contents []string `json:"contents"`
BlockIDs []string `json:"blockIDs"`
Contents []*Value `json:"contents"`
}
type ValueRollup struct {