mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(http): implement missing findByID methods (#1635)
* feat(http): implement missing methods * general cleanup * unify param handling * handle not found errors * unify err handlers * fix(http): fmt type
This commit is contained in:
parent
accc875960
commit
acb91e8709
15 changed files with 379 additions and 422 deletions
|
@ -67,7 +67,12 @@ func (s *service) Store(ctx context.Context, apiKey *domain.APIKey) error {
|
|||
}
|
||||
|
||||
func (s *service) Delete(ctx context.Context, key string) error {
|
||||
err := s.repo.Delete(ctx, key)
|
||||
_, err := s.repo.GetKey(ctx, key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = s.repo.Delete(ctx, key)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not delete api key: %s", key)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue