from flask import Blueprint
from models import db, Status
import json

status_renderer = Blueprint('status', __name__)

@status_renderer.route('/status/<int:user_id>')
def get_tweet(user_id):
    status = db.session.query(Status).order_by(Status.id.desc()).one()
    return json.dumps({'type' : 'text',
            'status_text' : status.status_text,
            'posted_by' : status.posted_by,
            'image_url' : status.pic_url,
            'profile_pic': status.profile_pic
        })

from flask import Blueprint
from models import db, Status
import json

status_renderer = Blueprint('status', __name__)

@status_renderer.route('/status')
def get_status():
    status = db.session.query(Status).order_by(Status.id.desc()).one()
    return json.dumps({'type' : 'text',
            'status_text' : status.status_text,
            'posted_by' : status.posted_by,
            'image_url' : status.pic_url,
            'profile_pic': status.profile_pic
        })

Remove user_id requirement for FB endpoint
Remove user_id requirement for FB endpoint

  from flask import Blueprint
  from models import db, Status
  import json
  
  status_renderer = Blueprint('status', __name__)
  
- @status_renderer.route('/status/<int:user_id>')
+ @status_renderer.route('/status')
- def get_tweet(user_id):
+ def get_status():
      status = db.session.query(Status).order_by(Status.id.desc()).one()
      return json.dumps({'type' : 'text',
              'status_text' : status.status_text,
              'posted_by' : status.posted_by,
              'image_url' : status.pic_url,
              'profile_pic': status.profile_pic
          })
  
Remove user_id requirement for FB endpoint
## Code Before:
from flask import Blueprint
from models import db, Status
import json

status_renderer = Blueprint('status', __name__)

@status_renderer.route('/status/<int:user_id>')
def get_tweet(user_id):
    status = db.session.query(Status).order_by(Status.id.desc()).one()
    return json.dumps({'type' : 'text',
            'status_text' : status.status_text,
            'posted_by' : status.posted_by,
            'image_url' : status.pic_url,
            'profile_pic': status.profile_pic
        })

## Instruction:
Remove user_id requirement for FB endpoint
## Code After:
from flask import Blueprint
from models import db, Status
import json

status_renderer = Blueprint('status', __name__)

@status_renderer.route('/status')
def get_status():
    status = db.session.query(Status).order_by(Status.id.desc()).one()
    return json.dumps({'type' : 'text',
            'status_text' : status.status_text,
            'posted_by' : status.posted_by,
            'image_url' : status.pic_url,
            'profile_pic': status.profile_pic
        })
