Spaces:
Paused
Paused
| from flask import Flask, jsonify, request | |
| app = Flask(__name__) | |
| def create_podcast(): | |
| data = request.json | |
| links = data.get('links') | |
| user_id = data.get('user_id') | |
| # Dummy logic to create a podcast | |
| if links and user_id: | |
| # Assuming the podcast is successfully created and assigned an ID of 2 | |
| response = { | |
| "data": { | |
| "id": 2 | |
| }, | |
| "success": True, | |
| "message": "Podcast created successfully" | |
| } | |
| return jsonify(response), 200 | |
| else: | |
| response = { | |
| "data": {}, | |
| "success": False, | |
| "message": "Podcast creation failed" | |
| } | |
| return jsonify(response), 500 | |
| if __name__ == '__main__': | |
| app.run(debug=True) | |