mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 04:09:29 +02:00
chore: Remove GetSourceByName
- Introduced in 5455605342
and removed in
the same commit. Usage was purely testing code.
This commit is contained in:
parent
1b10046e1a
commit
5423e22aeb
3 changed files with 2 additions and 18 deletions
|
@ -299,17 +299,6 @@ func GetSourceByID(ctx context.Context, id int64) (*Source, error) {
|
|||
return source, nil
|
||||
}
|
||||
|
||||
func GetSourceByName(ctx context.Context, name string) (*Source, error) {
|
||||
source := &Source{}
|
||||
has, err := db.GetEngine(ctx).Where("name = ?", name).Get(source)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
return nil, ErrSourceNotExist{}
|
||||
}
|
||||
return source, nil
|
||||
}
|
||||
|
||||
// UpdateSource updates a Source record in DB.
|
||||
func UpdateSource(ctx context.Context, source *Source) error {
|
||||
var originalSource *Source
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue