Skip to content

Commit

Permalink
update issue #484
Browse files Browse the repository at this point in the history
- Cleanup apis generic form/view.
- API client services should only list apis that are available for core in core app_type.
  • Loading branch information
oyeaussie committed Aug 24, 2024
1 parent 1267fe6 commit 038ecde
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 335 deletions.

This file was deleted.

This file was deleted.

12 changes: 2 additions & 10 deletions apps/Core/Views/Default/html/system/api/client/services/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
{% set title = 'API:' ~ api['category'] ~ ':' ~ api['provider'] ~ ' - ' ~ api['name'] %}
{% else %}
{% set apiId = '' %}
{% if api['repository'] is defined and api['repository'] === true %}
{% set title = 'New API:' ~ api['category'] %}
{% else %}
{% set title = 'New API:' ~ api['category'] ~ ':' ~ api['provider'] %}
{% endif %}
{% set title = 'New API:' ~ api['category'] ~ ':' ~ api['provider'] %}
{% endif %}
{% if api['repository'] is defined and api['repository'] === true %}
{{view.getPartial('../../modules/repositories/view')}}
{% else %}
{{view.getPartial('services/apis/' ~ api['category'] ~ '/' ~ api['provider']|lower ~ '/view')}}
{% endif %}
{{view.getPartial('services/apis/' ~ api['category'] ~ '/' ~ api['provider']|lower ~ '/view')}}
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,19 @@ protected function registerApiCategories()
{
$this->apiCategories = [];

$basepackagesApis = $this->modules->packages->getPackagesForCategory('basepackagesApis');
$apis = $this->modules->packages->getPackagesForCategory('appsApis');

$apis = array_merge($basepackagesApis, $apis);
if ($this->apps->getAppInfo()['app_type'] === 'core') {
$basepackagesApis = $this->modules->packages->getPackagesForCategory('basepackagesApis');
$apis = array_merge($basepackagesApis, $apis);
}

if ($apis && is_array($apis) && count($apis) > 0) {
foreach ($apis as $api) {
if ($this->apps->getAppInfo()['app_type'] !== $api['app_type']) {
continue;
}

$api['class'] = explode('\\', $api['class']);

$category = strtolower($api['class'][$this->helper->lastKey($api['class']) - 2]);
Expand Down

0 comments on commit 038ecde

Please sign in to comment.