Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhall17 committed Jul 8, 2020
1 parent 5be5641 commit 5bc4c01
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
11 changes: 7 additions & 4 deletions src/Panelist.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
class Panelist extends Model
{
protected $insertResource = 'MacsiDigital\Zoom\Requests\StorePanelist';

protected $endPoint = 'webinars/{webinar:id}/panelists';

protected $allowedMethods = ['get', 'post', 'put'];
protected $allowedMethods = ['get', 'post', 'delete'];

protected $apiMultipleDataField = 'panelists';

protected $apiMultipleDataField = '';
protected $wrapInOnInsert = 'panelists';
protected $wrapInEmptyArrayOnInsert = true;

public function updateAction($action){
$this->action = $action;
Expand All @@ -23,7 +26,7 @@ public function approve()
{
return $this->updateAction('approve');
}

public function deny()
{
return $this->updateAction('deny');
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/StoreWebinar.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class StoreWebinar extends PersistResource

protected $persistAttributes = [
'topic' => 'nullable|string',
'type' => 'nullable|integer|in:1,2,3,8',
'type' => 'nullable|integer|in:5,6,9',
'start_time' => 'nullable|date',
'duration' => 'nullable|integer',
'timezone' => 'nullable|string',
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/UpdateWebinar.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class UpdateWebinar extends PersistResource

protected $persistAttributes = [
'topic' => 'nullable|string',
'type' => 'nullable|integer|in:1,2,3,8',
'type' => 'nullable|integer|in:5,6,9',
'start_time' => 'nullable|date',
'duration' => 'nullable|integer',
'timezone' => 'nullable|string',
Expand Down
29 changes: 17 additions & 12 deletions src/Webinar.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Webinar extends Model
{
protected $insertResource = 'MacsiDigital\Zoom\Requests\StoreWebinar';
protected $updateResource = 'MacsiDigital\Zoom\Requests\UpdateWebinar';

protected $endPoint = 'webinars';

protected $customEndPoints = [
Expand All @@ -27,49 +27,54 @@ class Webinar extends Model
'created_at'
];

public function settings()
public function settings()
{
return $this->hasOne(WebinarSetting::class, 'settings');
}

public function registrants()
public function recurrence()
{
return $this->hasOne(Recurrence::class);
}

public function registrants()
{
return $this->hasMany(WebinarRegistrant::class);
}

public function occurrences()
public function occurrences()
{
return $this->hasMany(WebinarOccurrence::class);
}

public function panelists()
public function panelists()
{
return $this->hasMany(Panelist::class);
}

public function registrationQuestions()
public function registrationQuestions()
{
return $this->hasMany(RegistrationQuestion::class);
}

public function trackingField()
public function trackingField()
{
return $this->hasMany(TrackingField::class);
}

public function trackingSources()
public function trackingSources()
{
return $this->hasMany(TrackingSources::class);
}

public function polls()
public function polls()
{
return $this->hasMany(Poll::class);
return $this->hasMany(Poll::class);
}

public function endWebinar()
public function endWebinar()
{
return $this->newQuery()->sendRequest('put', ['webinars/'.$this->id.'/status', ['action' => 'end']])->successful();
}

}

0 comments on commit 5bc4c01

Please sign in to comment.