Return active and private from forms api
This commit is contained in:
parent
e299e8b159
commit
0fb259a373
|
@ -33,6 +33,8 @@ class FormApiResource extends JsonResource
|
||||||
'slug' => $this->slug,
|
'slug' => $this->slug,
|
||||||
'dates' => $this->from->equalTo($this->to) ? $this->from->format('d.m.Y') : $this->from->format('d.m.Y') . ' - ' . $this->to->format('d.m.Y'),
|
'dates' => $this->from->equalTo($this->to) ? $this->from->format('d.m.Y') : $this->from->format('d.m.Y') . ' - ' . $this->to->format('d.m.Y'),
|
||||||
'image' => $this->getMedia('headerImage')->first()->getFullUrl('square'),
|
'image' => $this->getMedia('headerImage')->first()->getFullUrl('square'),
|
||||||
|
'is_active' => $this->is_active,
|
||||||
|
'is_private' => $this->is_private,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,9 @@ class FormApiListActionTest extends FormTestCase
|
||||||
sleep(1);
|
sleep(1);
|
||||||
$this->get('/api/form?perPage=15&filter=' . $this->filterString(['inactive' => true]))->assertJsonCount(3, 'data');
|
$this->get('/api/form?perPage=15&filter=' . $this->filterString(['inactive' => true]))->assertJsonCount(3, 'data');
|
||||||
$this->get('/api/form?perPage=15&filter=' . $this->filterString(['inactive' => false]))->assertJsonCount(2, 'data');
|
$this->get('/api/form?perPage=15&filter=' . $this->filterString(['inactive' => false]))->assertJsonCount(2, 'data');
|
||||||
$this->get('/api/form?perPage=15&filter=' . $this->filterString([]))->assertJsonCount(2, 'data');
|
$this->get('/api/form?perPage=15&filter=' . $this->filterString([]))->assertJsonCount(2, 'data')
|
||||||
|
->assertJsonPath('data.0.is_active', true)
|
||||||
|
->assertJsonPath('data.0.is_private', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItDisplaysDailyForms(): void
|
public function testItDisplaysDailyForms(): void
|
||||||
|
|
Loading…
Reference in New Issue