diff --git a/.gitignore b/.gitignore index 0dc6c8f..93501f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /apivenv/ -/.vscode/ \ No newline at end of file +/.vscode/ +/.pytest_cache/ \ No newline at end of file diff --git a/api.py b/api.py index 1a63cdb..342bf6a 100644 --- a/api.py +++ b/api.py @@ -10,5 +10,14 @@ def create_red_flag(): all_redflags.append(red_flag) return jsonify({"status" : 201, "data" : [{"id" : red_flag['id'], "message" : "Created red-flag record”"}]}), 201 +@app.route('/api/v1/redflags', methods=['GET']) +def get_red_flag(): + return jsonify({"status" : 200, "data" : all_redflags}) + +@app.route('/api/v1/redflags/', methods=['GET']) +def get_specific_red_flag(id): + flag = [flags for flags in all_redflags if flags['id'] == id] + return jsonify({"data" : flag[0], "status" : 200}) + if __name__ == "__main__": app.run(debug=True) \ No newline at end of file