mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Create/update/remove domain permission subscriptions (#3623)
* [feature] Create/update/remove domain permission subscriptions * lint * envparsing * remove errant fmt.Println * create drafts, subs, exclude, from snapshot models * name etag column correctly * remove count column * lint
This commit is contained in:
@ -115,3 +115,19 @@ func (p *Processor) apiDomainPerm(
|
||||
|
||||
return apiDomainPerm, nil
|
||||
}
|
||||
|
||||
// apiDomainPermSub is a cheeky shortcut for returning the
|
||||
// API version of the given domain permission subscription,
|
||||
// or an appropriate error if something goes wrong.
|
||||
func (p *Processor) apiDomainPermSub(
|
||||
ctx context.Context,
|
||||
domainPermSub *gtsmodel.DomainPermissionSubscription,
|
||||
) (*apimodel.DomainPermissionSubscription, gtserror.WithCode) {
|
||||
apiDomainPermSub, err := p.converter.DomainPermSubToAPIDomainPermSub(ctx, domainPermSub)
|
||||
if err != nil {
|
||||
err := gtserror.NewfAt(3, "error converting domain permission subscription to api model: %w", err)
|
||||
return nil, gtserror.NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
return apiDomainPermSub, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user