[feature] Add domain permission drafts and excludes (#3547)

* [feature] Add domain permission drafts and excludes

* fix typescript complaining

* lint

* make filenames more consistent

* test own domain excluded
This commit is contained in:
tobi
2024-11-21 14:09:58 +01:00
committed by GitHub
parent c2029df9bc
commit 301543616b
69 changed files with 5664 additions and 264 deletions

View File

@@ -1962,7 +1962,8 @@ func (c *Converter) ConversationToAPIConversation(
return apiConversation, nil
}
// DomainPermToAPIDomainPerm converts a gts model domin block or allow into an api domain permission.
// DomainPermToAPIDomainPerm converts a gtsmodel domain block,
// allow, draft, or ignore into an api domain permission.
func (c *Converter) DomainPermToAPIDomainPerm(
ctx context.Context,
d gtsmodel.DomainPermission,
@@ -1995,6 +1996,11 @@ func (c *Converter) DomainPermToAPIDomainPerm(
domainPerm.CreatedBy = d.GetCreatedByAccountID()
domainPerm.CreatedAt = util.FormatISO8601(d.GetCreatedAt())
// If this is a draft, also add the permission type.
if _, ok := d.(*gtsmodel.DomainPermissionDraft); ok {
domainPerm.PermissionType = d.GetType().String()
}
return domainPerm, nil
}