mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
Added FederationInfo Create function
This commit is contained in:
parent
380d3db0bf
commit
1f989f2ecd
3 changed files with 19 additions and 16 deletions
|
@ -42,3 +42,11 @@ func FindFederationInfoByHostFqdn(ctx context.Context, fqdn string) (*Federation
|
|||
}
|
||||
return info, nil
|
||||
}
|
||||
|
||||
func CreateFederationInfo(ctx context.Context, info FederationInfo) error {
|
||||
if res, err := validation.IsValid(info); !res {
|
||||
return fmt.Errorf("FederationInfo is not valid: %v", err)
|
||||
}
|
||||
_, err := db.GetEngine(ctx).Insert(info)
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue