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

Jobs #25

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Jobs #25

Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ psycopg2-binary = "*"
python-dotenv = "*"
gunicorn = "*"
email-validator = "*"
flask-mail = "*"

[dev-packages]

Expand Down
25 changes: 17 additions & 8 deletions backend/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed backend/__pycache__/app.cpython-38.pyc
Binary file not shown.
Binary file removed backend/__pycache__/models.cpython-38.pyc
Binary file not shown.
21 changes: 21 additions & 0 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from itsdangerous import URLSafeTimedSerializer, SignatureExpired, BadSignature
from flask_mail import Mail, Message


from models import db, User, JobPosting, Proposal, Payment, Usermessage, Project, Milestone, Rating

# Initialize Flask app
Expand Down Expand Up @@ -447,6 +448,26 @@ def delete_proposal(proposal_id):
db.session.commit()
return jsonify({"message": "Proposal deleted"}), 200

# ================================ track proposals ================================

@app.route('/proposals', methods=['POST'])
def submit_proposal():
data = request.json
proposal = Proposal(
freelancer_id=data['freelancer_id'],
job_posting_id=data['job_posting_id'],
content=data['content']
)
db.session.add(proposal)
db.session.commit()
return jsonify(proposal.to_dict()), 201

@app.route('/proposals/<int:freelancer_id>', methods=['GET'])
def track_proposals(freelancer_id):
proposals = Proposal.query.filter_by(freelancer_id=freelancer_id).all()
return jsonify([proposal.to_dict() for proposal in proposals]), 200



# ================================ PAYMENTS ================================

Expand Down
Binary file removed backend/instance/app.db
Binary file not shown.
1 change: 0 additions & 1 deletion backend/migrations/README

This file was deleted.

Binary file removed backend/migrations/__pycache__/env.cpython-38.pyc
Binary file not shown.
50 changes: 0 additions & 50 deletions backend/migrations/alembic.ini

This file was deleted.

113 changes: 0 additions & 113 deletions backend/migrations/env.py

This file was deleted.

24 changes: 0 additions & 24 deletions backend/migrations/script.py.mako

This file was deleted.

Loading