1
0
Fork 0
mirror of synced 2024-09-29 08:51:28 +13:00

Merge console and project clients

This commit is contained in:
eldadfux 2019-08-25 20:18:06 +03:00
parent 20f5585641
commit d23aedacd6

View file

@ -31,14 +31,23 @@ $webhook = new Event('v1-webhooks', 'WebhooksV1');
$audit = new Event('v1-audits', 'AuditsV1');
$usage = new Event('v1-usage', 'UsageV1');
$clients = array_map(function($node) {
$clientsConsole = array_map(function($node) {
return $node['url'];
}, array_filter($console->getAttribute('platforms', []), function($node) {
if(isset($node['type']) && $node['type'] === 'web' && isset($node['url']) && !empty($node['url'])) {
return true;
}
return false;
}));
$clients = array_merge($clientsConsole, array_map(function($node) {
return $node['url'];
}, array_filter($project->getAttribute('platforms', []), function($node) {
if(isset($node['type']) && $node['type'] === 'web' && isset($node['url']) && !empty($node['url'])) {
return true;
}
return false;
}));
})));
$utopia->init(function() use ($utopia, $request, $response, $register, &$user, $project, $roles, $webhook, $audit, $usage, $domain, $clients) {