feat(market): add Minha Intenções tab with panel, hook, and badge
- Introduced "Minhas Intenções" tab visible only to logged-in users. - Integrated MyPurchaseIntentionsPanel and useMyPurchaseIntentions hook. - Added tab badge showing count of pending intentions. - Extended session API to include user’s main character for downstream features.
This commit is contained in:
1 parent
f35fee944d
commit
7f42def478
55 files changed
+4906
-95
No files matched your search
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Schemas de validação para Chat usando Zod
|
||||
*/
|
||||
|
||||
import { z } from "zod";
|
||||
import sanitizeHtml from "sanitize-html";
|
||||
|
||||
// Schema para criar chat
|
||||
export const createChatSchema = z.object({
|
||||
listing_id: z.number().int().positive(),
|
||||
buyer_message: z.string().max(1000).optional(),
|
||||
});
|
||||
|
||||
// Schema para enviar mensagem
|
||||
export const sendMessageSchema = z.object({
|
||||
content: z
|
||||
.string()
|
||||
.min(1, "Mensagem não pode estar vazia")
|
||||
.max(1000, "Mensagem muito longa (máximo 1000 caracteres)")
|
||||
.transform((val) => sanitizeHtml(val.trim(), { allowedTags: [], allowedAttributes: {} })),
|
||||
});
|
||||
|
||||
// Schema para query params de mensagens
|
||||
export const getMessagesSchema = z.object({
|
||||
page: z.coerce.number().int().positive().default(1),
|
||||
limit: z.coerce.number().int().positive().max(100).default(50),
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user