from flask import Flask, jsonify
from flask.templating import render_template
from app import app
from Classes.models import Class

#Routes that mostly interact with classes

#Create a Class
@app.route('/classes/create', methods=['POST'])
def new_class():
    return Class().new_class()

#Join a Class
@app.route('/classes/join', methods=['POST'])
def join_class():
    return Class().join_class()

#Update a Class
@app.route('/classes/update', methods=['POST'])
def update_class():
    return Class().update_class()

#Update the topic for a Class
@app.route('/classes/update_topic', methods=['PUT'])
def update_topic():
    return Class().update_topic()

#Delete a Class
@app.route('/classes/delete', methods=['DELETE'])
def delete_class():
    print('deleting class')
    return Class().delete_class()