diff --git a/service/api/comments.go b/service/api/comments.go index b7f502f..aade789 100644 --- a/service/api/comments.go +++ b/service/api/comments.go @@ -89,14 +89,14 @@ func (rt *_router) PostComment(w http.ResponseWriter, r *http.Request, ps httpro } // check if the comment is valid (should not contain newlines and at be between 5 and 255 characters) - stat, err := regexp.Match(`^[*]{5, 255}$`, []byte(request_body.Comment)) + stat, err := regexp.Match(`^(.*)*`, []byte(request_body.Comment)) if err != nil { helpers.SendInternalError(err, "Error matching regex", w, rt.baseLogger) return } - if !stat { + if !stat || len(request_body.Comment) < 5 || len(request_body.Comment) > 255 { helpers.SendBadRequest(w, "Invalid comment", rt.baseLogger) return } diff --git a/service/database/db-comments.go b/service/database/db-comments.go index 9e4ff0c..3708732 100644 --- a/service/database/db-comments.go +++ b/service/database/db-comments.go @@ -103,6 +103,7 @@ func (db *appdbimpl) GetComments(uid string, photo_id int64, requesting_uid stri AND "bans"."ban" = ? ) AND "u"."uid" = "c"."user" + ORDER BY "c"."date" DESC LIMIT ? OFFSET ?`, photo_id, requesting_uid, limit, start_index) diff --git a/webui/src/App.vue b/webui/src/App.vue index 39dfa1f..f46c62f 100644 --- a/webui/src/App.vue +++ b/webui/src/App.vue @@ -1,13 +1,28 @@ + @@ -69,7 +84,7 @@ export default { - + diff --git a/webui/src/components/Modal.vue b/webui/src/components/Modal.vue new file mode 100644 index 0000000..b53788b --- /dev/null +++ b/webui/src/components/Modal.vue @@ -0,0 +1,27 @@ + + + \ No newline at end of file diff --git a/webui/src/components/PostCard.vue b/webui/src/components/PostCard.vue index 3c1db9a..6e23e4d 100644 --- a/webui/src/components/PostCard.vue +++ b/webui/src/components/PostCard.vue @@ -1,18 +1,53 @@