forked from mtusi2026/mtusi2026lab2
refactor(app) AI refactoring before moving to Lab3 done
This commit is contained in:
@@ -16,11 +16,11 @@ func NewHandler(st *store.Store) *Handler {
|
||||
}
|
||||
|
||||
type CreateMessageRequest struct {
|
||||
Text string `json:"text" validate:"required"`
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
func (h *Handler) CreateMessage(c fiber.Ctx) error {
|
||||
userID := c.Locals("userID").(uuid.UUID)
|
||||
userID := common.MustUserID(c)
|
||||
|
||||
chatID, err := uuid.Parse(c.Params("chat_id"))
|
||||
if err != nil {
|
||||
@@ -45,7 +45,7 @@ func (h *Handler) CreateMessage(c fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func (h *Handler) ListMessages(c fiber.Ctx) error {
|
||||
userID := c.Locals("userID").(uuid.UUID)
|
||||
userID := common.MustUserID(c)
|
||||
|
||||
chatID, err := uuid.Parse(c.Params("chat_id"))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user