mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-31 23:12:25 -05:00
restructure a bunch, get unfaves working
This commit is contained in:
parent
de3b6bc6d9
commit
1f44b06c06
25 changed files with 1190 additions and 681 deletions
|
|
@ -23,18 +23,19 @@ import (
|
|||
|
||||
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
)
|
||||
|
||||
func (p *processor) InstanceGet(domain string) (*apimodel.Instance, ErrorWithCode) {
|
||||
func (p *processor) InstanceGet(domain string) (*apimodel.Instance, gtserror.WithCode) {
|
||||
i := >smodel.Instance{}
|
||||
if err := p.db.GetWhere([]db.Where{{Key: "domain", Value: domain}}, i); err != nil {
|
||||
return nil, NewErrorInternalError(fmt.Errorf("db error fetching instance %s: %s", p.config.Host, err))
|
||||
return nil, gtserror.NewErrorInternalError(fmt.Errorf("db error fetching instance %s: %s", p.config.Host, err))
|
||||
}
|
||||
|
||||
ai, err := p.tc.InstanceToMasto(i)
|
||||
if err != nil {
|
||||
return nil, NewErrorInternalError(fmt.Errorf("error converting instance to api representation: %s", err))
|
||||
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting instance to api representation: %s", err))
|
||||
}
|
||||
|
||||
return ai, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue