Correct /store/addons api output (#4589)

This commit is contained in:
Mike Degatano 2023-09-29 09:17:39 -04:00 committed by GitHub
parent 0cd7bd47bb
commit fa90c247ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -186,12 +186,14 @@ class APIStore(CoreSysAttributes):
}
@api_process
async def addons_list(self, request: web.Request) -> list[dict[str, Any]]:
async def addons_list(self, request: web.Request) -> dict[str, Any]:
"""Return all store add-ons."""
return [
self._generate_addon_information(self.sys_addons.store[addon])
for addon in self.sys_addons.store
]
return {
ATTR_ADDONS: [
self._generate_addon_information(self.sys_addons.store[addon])
for addon in self.sys_addons.store
]
}
@api_process
def addons_addon_install(self, request: web.Request) -> Awaitable[None]:

View File

@ -50,7 +50,7 @@ async def test_api_store_addons(api_client: TestClient, store_addon: AddonStore)
result = await resp.json()
print(result)
assert result["data"][-1]["slug"] == store_addon.slug
assert result["data"]["addons"][-1]["slug"] == store_addon.slug
@pytest.mark.asyncio