twitter #2
@ -135,23 +135,16 @@ def delete_twitter_campaign():
|
||||
|
||||
return "Twitter campaign succesfully deleted.", 200
|
||||
|
||||
@campaign.route('/details', methods=['GET'])
|
||||
def get_twitter_campaign_details():
|
||||
@campaign.route('/<campaign_id>', methods=['GET'])
|
||||
def get_twitter_campaign_details(campaign_id):
|
||||
decoded_token = verify_token(request.headers)
|
||||
if not decoded_token:
|
||||
return "Not authorised!", 401
|
||||
|
||||
user_id = decoded_token['sub']
|
||||
|
||||
content_type = request.headers.get('Content-Type')
|
||||
if content_type != 'application/json':
|
||||
return "Content-type not supported!", 400
|
||||
|
||||
if 'campaign_id' not in request.headers:
|
||||
return "Invalid request!", 400
|
||||
|
||||
twitter_campaign = TwitterCampaign.query.filter_by(user_id=user_id, id=request.headers['campaign_id']).first()
|
||||
campaign_posts = TwitterPost.query.filter_by(user_id=user_id, campaign_id=request.headers['campaign_id']).all()
|
||||
twitter_campaign = TwitterCampaign.query.filter_by(user_id=user_id, id=campaign_id).first()
|
||||
campaign_posts = TwitterPost.query.filter_by(user_id=user_id, campaign_id=campaign_id).all()
|
||||
|
||||
posts = []
|
||||
for post in campaign_posts:
|
||||
|
Loading…
Reference in New Issue
Block a user