move routes in seperate files; better error handling for enpoint functions

This commit is contained in:
2025-01-02 15:05:20 +01:00
parent b1719704e4
commit 59222160af
5 changed files with 118 additions and 88 deletions

View File

@@ -13,8 +13,8 @@ type ArticleViewModel struct {
func NewArticleViewModel(a *model.Article) *ArticleViewModel {
summary := a.Content
if len(a.Content) > 200 {
summary = summary[:200]
if len(a.Content) > 300 {
summary = summary[:300]
}
return &ArticleViewModel{