feat(chat): store chats in Postgres

This commit is contained in:
kk10
2026-10-05 12:54:51 +03:00
parent c99f6f02c5
commit 04f7c046b6
4 changed files with 116 additions and 32 deletions
+3 -2
View File
@@ -27,8 +27,9 @@ type ChatPageResponse struct {
}
func (r CreateChatRequest) Validate() bool {
titleLen := utf8.RuneCountInString(r.Title)
if strings.TrimSpace(r.Title) == "" || titleLen > 100 {
if strings.TrimSpace(r.Title) == "" ||
strings.ContainsRune(r.Title, 0) ||
utf8.RuneCountInString(r.Title) > 100 {
return false
}