This commit is contained in:
Timothy Jaeryang Baek
2024-11-16 17:49:13 -08:00
parent af0ba53715
commit a1ce8422fd
9 changed files with 67 additions and 69 deletions

View File

@@ -61,6 +61,7 @@ class PromptForm(BaseModel):
command: str
title: str
content: str
access_control: Optional[dict] = None
class PromptsTable:
@@ -124,6 +125,7 @@ class PromptsTable:
prompt = db.query(Prompt).filter_by(command=command).first()
prompt.title = form_data.title
prompt.content = form_data.content
prompt.access_control = form_data.access_control
prompt.timestamp = int(time.time())
db.commit()
return PromptModel.model_validate(prompt)