Spaces:
Paused
Paused
File size: 818 Bytes
99e8d72 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/api/podcasts', methods=['POST'])
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)
|