Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amethyst - Angela, Hannah, Elaine, Maz, Raina #22

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
079839a
migrations
Rainacam12 Jun 26, 2023
4e04f67
model import statements added into init.py
Rainacam12 Jun 26, 2023
2ce2c1b
Created class Card model
angela100743 Jun 26, 2023
f475c4e
board model added
Rainacam12 Jun 26, 2023
eb23010
Fixed mistake on autoincrement
angela100743 Jun 26, 2023
d3cb87f
corrected import statments
Rainacam12 Jun 26, 2023
eb52013
Merge branch 'main' of https://github.com/Hannah1Watkins/back-end-ins…
Rainacam12 Jun 26, 2023
c4d6592
est. relationship between card and board in board
Rainacam12 Jun 26, 2023
e87501f
Set up relationship with Board in class Card
angela100743 Jun 26, 2023
502c477
connected card and board w/ foreignkey
Rainacam12 Jun 26, 2023
baceba5
Merge branch 'main' of https://github.com/Hannah1Watkins/back-end-ins…
angela100743 Jun 26, 2023
fdef0aa
Merge branch 'main' of https://github.com/Hannah1Watkins/back-end-ins…
angela100743 Jun 26, 2023
26dffc0
Create from_dict and to_dict for CARD
angela100743 Jun 27, 2023
3d853ca
Post method created for card - not working on Postman yet
angela100743 Jun 27, 2023
550fcba
Added GET and DELETE routes for CARD
angela100743 Jun 27, 2023
659579c
added board routes
Rainacam12 Jun 27, 2023
d312aad
created separate routes in folder
Rainacam12 Jun 27, 2023
7e74ba3
to_dict and from_dict funcs restored in board.py
Rainacam12 Jun 27, 2023
55e8ac8
registered bps
Rainacam12 Jun 27, 2023
884504b
Indentation fixed for from_dict and to_dict
angela100743 Jun 27, 2023
8453573
Get all cards route in progress, instructions added
angela100743 Jun 27, 2023
496f4e9
Migrations folder updated
angela100743 Jun 27, 2023
e2dd482
Created entire new migrations folder
angela100743 Jun 27, 2023
b748918
added deletions
mlweir98 Jun 27, 2023
4a8a6d9
added migrations
mlweir98 Jun 27, 2023
5eed4a2
Patch endpoint created to update liked_count, POST by board_id, GET c…
angela100743 Jun 27, 2023
24a38c0
updated routes to make functionality work
mlweir98 Jun 28, 2023
2dd52c0
delete board route created
Rainacam12 Jun 28, 2023
df93adb
updated board model to_dict method to include cards
mlweir98 Jun 28, 2023
e4d2a4c
updated the board component, cards attribute to serialize
ewatki Jun 29, 2023
0a71256
updated cors headers to fix error
mlweir98 Jun 29, 2023
c206a64
added user login routes
Hannah1Watkins Jul 18, 2023
fba7c36
backend reconnect
Rainacam12 Jul 18, 2023
6f0eb34
changed user.py file to include first name & last for registration
Hannah1Watkins Jul 19, 2023
473223d
Merge branch 'main' of https://github.com/Hannah1Watkins/back-end-ins…
Hannah1Watkins Jul 19, 2023
2c6f0a0
changed user_routes.py file to include first name & last for registra…
Hannah1Watkins Jul 19, 2023
1e3f16f
commit
mlweir98 Jul 20, 2023
770057e
Updated render link to init file
angela100743 Jul 21, 2023
fe63fdc
New migrations created after render connection built
angela100743 Jul 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Post method created for card - not working on Postman yet
  • Loading branch information
angela100743 committed Jun 27, 2023
commit 3d853cac209520761c53622be9b2851f1c4c48ea
14 changes: 14 additions & 0 deletions app/routes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
from flask import Blueprint, request, jsonify, make_response
from app import db
from app.models.card import Card

# example_bp = Blueprint('example_bp', __name__)
cards_bp = Blueprint("cards", __name__, url_prefix="/cards")

@cards_bp.route("", methods=["POST"])

def create_card():
request_body = request.get_json()

new_card = Card.from_dict(request_body)

db.session.add(new_card)
db.session.commit()

return jsonify(new_card.to_dict()), 201