mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
do active center filtering in frontend for person creation
This commit is contained in:
@@ -53,8 +53,6 @@ class PersonApiController extends ApiController
|
||||
{
|
||||
$centers = $this->authorizedCenterOnPersonCreation->getCenters();
|
||||
|
||||
// $centersActive = array_filter($centers, fn(Center $c) => $c->getIsActive());
|
||||
|
||||
return $this->json(
|
||||
['showCenters' => $this->showCenters, 'centers' => $centers],
|
||||
Response::HTTP_OK,
|
||||
|
@@ -329,12 +329,13 @@ export default {
|
||||
if (this.action !== 'create') {
|
||||
this.loadData();
|
||||
} else {
|
||||
console.log('show centers', this.showCenters);
|
||||
// console.log('show centers', this.showCenters);
|
||||
getCentersForPersonCreation()
|
||||
.then(params => {
|
||||
this.config.centers = params.centers;
|
||||
this.config.centers = params.centers.filter(c => c.isActive);
|
||||
this.showCenters = params.showCenters;
|
||||
console.log('show centers inside', this.showCenters);
|
||||
// console.log('centers', this.config.centers)
|
||||
// console.log('show centers inside', this.showCenters);
|
||||
if (this.showCenters && this.config.centers.length === 1) {
|
||||
this.person.center = this.config.centers[0];
|
||||
}
|
||||
|
Reference in New Issue
Block a user