Compare commits

...

7 Commits
3.x ... v2.3.11

Author SHA1 Message Date
James Brooks
2e5e8b1545 Bump version to 2.3.11 2017-04-12 23:05:09 +01:00
James Brooks
7e556d5dba Apply fixes from StyleCI (#2486)
[ci skip] [skip ci]
2017-04-12 23:04:21 +01:00
James Brooks
331e176fbc Updated deps 2017-03-25 11:42:25 +00:00
James Brooks
bde0abe472 Fix handling of individual component subscriptions via API 2016-09-21 18:35:58 +01:00
James Brooks
f2bf2eff68 Test creating a subscriber returns subscriptions 2016-09-21 18:17:22 +01:00
James Brooks
50ab96fc4f Load subscriptions when creating a subscriber 2016-09-21 18:16:08 +01:00
James Brooks
3cbee1302e Update deps 2016-09-21 18:08:56 +01:00
5 changed files with 424 additions and 386 deletions

View File

@@ -1 +1 @@
2.3.11-dev
2.3.11

View File

@@ -44,17 +44,17 @@ class SubscribeSubscriberCommandHandler
// Decide what to subscribe the subscriber to.
if ($subscriptions = $command->subscriptions) {
$subscriptions = Component::whereIn('id', $subscriptions);
$components = Component::whereIn('id', $subscriptions)->get();
} else {
$subscriptions = Component::all();
$components = Component::all();
}
foreach ($subscriptions as $component) {
$components->map(function ($component) use ($subscriber) {
Subscription::create([
'subscriber_id' => $subscriber->id,
'component_id' => $component->id,
]);
}
});
if ($command->verified) {
dispatch(new VerifySubscriberCommand($subscriber));
@@ -62,6 +62,8 @@ class SubscribeSubscriberCommandHandler
event(new SubscriberHasSubscribedEvent($subscriber));
}
$subscriber->load('subscriptions');
return $subscriber;
}
}

View File

@@ -13,7 +13,6 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\Subscriber;
use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriberCommand;
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasUnsubscribedEvent;
use CachetHQ\Cachet\Models\Subscriber;
class UnsubscribeSubscriberCommandHandler
{

796
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -82,6 +82,7 @@ class SubscriberTest extends AbstractApiTestCase
$this->assertResponseOk();
$this->seeHeader('Content-Type', 'application/json');
$this->seeJson(['email' => 'support@alt-three.com']);
$this->seeJsonStructure(['data' => ['subscriptions' => []]]);
}
public function testDeleteSubscriber()