Commit 161b03d5 authored by Guillermo Sanz López's avatar Guillermo Sanz López
Browse files

add num apis

parent 22a698fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ def delete_user(username, password):
@backoffice_routes.route("/apis", methods=["GET"])
@jwt_required()
def get_apis():
    return operations.get_apis()
    return operations.get_apis1()

@backoffice_routes.route("/apis/num", methods=["GET"])
@jwt_required()
+10 −0
Original line number Diff line number Diff line
@@ -307,3 +307,13 @@ class Operations:
        except Exception as e:
            # Devuelve una respuesta JSON con un mensaje de error
            return jsonify({"error": f"Error when retrieving number of APIs: {e}"}), 500

    def get_apis1(self):
        mycol = self.db.get_col_by_name(self.db.services)
        apis = mycol.find({}, {"_id": 0})

        json_apis = []
        for api in apis:
            json_apis.append(api)

        return json_apis
 No newline at end of file