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

add num apis

parent c3a22e33
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -255,6 +255,16 @@ class Operations:
            # Devolver un mensaje de error en caso de excepción
            return jsonify(message=f"Error deleting user: {str(e)}"), 500
    
    def get_apis(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
    
    def get_num_apis(self):
        try:
            # Carga la cadena JSON de las APIs y conviértela a un objeto Python
@@ -266,13 +276,3 @@ 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