1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 18:10:49 +09:00

objectType create remove name empty check

This commit is contained in:
Roman Khafizianov 2022-11-23 18:06:45 +01:00
parent 5ba07f804c
commit b30b32a1a1
No known key found for this signature in database
GPG key ID: F07A7D55A2684852
2 changed files with 1 additions and 4 deletions

View file

@ -52,6 +52,7 @@ func (p *Set) Init(ctx *smartblock.InitContext) (err error) {
templates := []template.StateTransformer{
template.WithDataviewRelationMigrationRelation(template.DataviewBlockId, bundle.TypeKeyBookmark.URL(), bundle.RelationKeyUrl, bundle.RelationKeySource),
template.WithObjectTypesAndLayout([]string{bundle.TypeKeySet.URL()}, model.ObjectType_set),
template.WithForcedDetail(bundle.RelationKeyLayout, pbtypes.Float64(float64(model.ObjectType_set))),
template.WithForcedDetail(bundle.RelationKeyFeaturedRelations, pbtypes.StringList(featuredRelations)),
template.WithDescription,
template.WithFeaturedRelations,

View file

@ -603,10 +603,6 @@ func (w *Workspaces) createObjectType(st *state.State, details *types.Struct) (i
return "", nil, fmt.Errorf("create object type: no data")
}
if pbtypes.GetString(details, bundle.RelationKeyName.String()) == "" {
return "", nil, fmt.Errorf("name is empty")
}
var recommendedRelationIds []string
for _, relId := range pbtypes.GetStringList(details, bundle.RelationKeyRecommendedRelations.String()) {
relKey := strings.TrimPrefix(relId, addr.BundledRelationURLPrefix)