From 41e0e65a6bed6446055905dd1ed5ea35471a5a18 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 25 Nov 2021 10:35:31 +0000 Subject: [PATCH] Add more info to /api/homepage/ --- app/blueprints/api/endpoints.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/blueprints/api/endpoints.py b/app/blueprints/api/endpoints.py index d6d4b84c..9dab51ed 100644 --- a/app/blueprints/api/endpoints.py +++ b/app/blueprints/api/endpoints.py @@ -13,6 +13,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from typing import List from flask import request, jsonify, current_app from flask_login import current_user, login_required @@ -431,8 +432,8 @@ def homepage(): downloads_result = db.session.query(func.sum(Package.downloads)).one_or_none() downloads = 0 if not downloads_result or not downloads_result[0] else downloads_result[0] - def mapPackages(packages): - return [pkg.getAsDictionaryKey() for pkg in packages] + def mapPackages(packages: List[Package]): + return [pkg.getAsDictionaryShort(current_app.config["BASE_URL"]) for pkg in packages] return jsonify({ "count": count,