mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
110067722: Added endpoints for add-service
Post is not complete as of yet.
This commit is contained in:
23
app/main/views/add_service.py
Normal file
23
app/main/views/add_service.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from flask import render_template, jsonify, redirect
|
||||
from flask_login import login_required
|
||||
|
||||
from app.main import main
|
||||
from app.main.forms import AddServiceForm
|
||||
|
||||
|
||||
@main.route("/add-service", methods=['GET'])
|
||||
@login_required
|
||||
def add_service():
|
||||
return render_template('views/add-service.html', form=AddServiceForm())
|
||||
|
||||
|
||||
@main.route("/add-service", methods=['POST'])
|
||||
@login_required
|
||||
def process_add_service():
|
||||
form = AddServiceForm()
|
||||
|
||||
if form.validate_on_submit():
|
||||
|
||||
return redirect('/dashboard')
|
||||
else:
|
||||
return jsonify(form.errors), 400
|
||||
Reference in New Issue
Block a user