fix: template defects
This commit is contained in:
@@ -34,6 +34,7 @@ def get_markdown_template(template_id):
|
||||
def get_markdown_templates():
|
||||
with get_db() as session:
|
||||
templates = session.query(MarkdownTemplate).all()
|
||||
print(templates)
|
||||
return jsonify([inflate_template(template.to_dict()) for template in templates]), 200
|
||||
|
||||
|
||||
@@ -66,10 +67,10 @@ def update_markdown_template(template_id):
|
||||
return jsonify({'error': 'markdown template not found'}), 400
|
||||
title = data.get("title", template.title)
|
||||
parameters = data.get("parameters", template.parameters)
|
||||
define = data.get("define", template.define)
|
||||
layout = data.get("layout", template.layout)
|
||||
template.title = title
|
||||
template.parameters = parameters
|
||||
template.define = define
|
||||
template.layout = layout
|
||||
session.commit()
|
||||
if template_id in cached_templates.keys():
|
||||
cached_templates[template_id] = inflate_template(template.to_dict())
|
||||
|
||||
Reference in New Issue
Block a user