🗃️ Fixed subscription memory repository Delete signature
/ docker (push) Successful in 1m21s
Details
/ docker (push) Successful in 1m21s
Details
This commit is contained in:
parent
891b6cf7a6
commit
686c1088a9
|
@ -39,13 +39,13 @@ func (repo *memorySubscriptionRepository) Create(ctx context.Context, suid domai
|
|||
return nil
|
||||
}
|
||||
|
||||
func (repo *memorySubscriptionRepository) Delete(ctx context.Context, suid domain.SUID) error {
|
||||
func (repo *memorySubscriptionRepository) Delete(ctx context.Context, suid domain.SUID) (bool, error) {
|
||||
if _, err := repo.Get(ctx, suid); err != nil {
|
||||
if !errors.Is(err, subscription.ErrNotExist) {
|
||||
return fmt.Errorf("cannot delete subscription: %w", err)
|
||||
return false, fmt.Errorf("cannot delete subscription: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
return false, nil
|
||||
}
|
||||
|
||||
repo.mutex.Lock()
|
||||
|
@ -53,7 +53,7 @@ func (repo *memorySubscriptionRepository) Delete(ctx context.Context, suid domai
|
|||
|
||||
delete(repo.subscriptions, suid)
|
||||
|
||||
return nil
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (repo *memorySubscriptionRepository) Get(_ context.Context, suid domain.SUID) (*domain.Subscription, error) {
|
||||
|
|
Loading…
Reference in New Issue