style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
@@ -4,8 +4,8 @@
|
||||
import { connectMongoDB } from "@/lib/mongodb/connection";
|
||||
import { Chat } from "@/lib/mongodb/models/Chat";
|
||||
import { Message } from "@/lib/mongodb/models/Message";
|
||||
import { getSocketIO } from "@/lib/socket/server";
|
||||
import { secureLogger } from "@/lib/secure-logger";
|
||||
import { getSocketIO } from "@/lib/socket/server";
|
||||
|
||||
interface CreateSystemMessageParams {
|
||||
listingId: number;
|
||||
@@ -22,7 +22,7 @@ interface CreateSystemMessageParams {
|
||||
* Cria uma mensagem do sistema no chat e notifica os participantes
|
||||
*/
|
||||
export async function createSystemMessageInChat(
|
||||
params: CreateSystemMessageParams
|
||||
params: CreateSystemMessageParams,
|
||||
): Promise<void> {
|
||||
try {
|
||||
await connectMongoDB();
|
||||
@@ -38,7 +38,7 @@ export async function createSystemMessageInChat(
|
||||
// Buscar dados do listing para cache
|
||||
const { getListingById } = await import("@/lib/prisma/queries/listings");
|
||||
const listing = await getListingById(params.listingId);
|
||||
|
||||
|
||||
if (!listing) {
|
||||
throw new Error("Listing não encontrado");
|
||||
}
|
||||
@@ -53,7 +53,9 @@ export async function createSystemMessageInChat(
|
||||
}
|
||||
|
||||
// Buscar personagem principal do comprador e vendedor
|
||||
const { getMainCharacter } = await import("@/lib/prisma/queries/characters");
|
||||
const { getMainCharacter } = await import(
|
||||
"@/lib/prisma/queries/characters"
|
||||
);
|
||||
const buyerCharacter = await getMainCharacter(params.buyerId);
|
||||
const sellerCharacter = await getMainCharacter(params.sellerId);
|
||||
|
||||
@@ -70,7 +72,9 @@ export async function createSystemMessageInChat(
|
||||
item_image_url: null, // Pode ser preenchido depois se necessário
|
||||
price_pix: listing.price_pix ? Number(listing.price_pix) : undefined,
|
||||
price_tibia_coins: listing.price_tibia_coins || undefined,
|
||||
price_gold_coins: listing.price_gold_coins ? Number(listing.price_gold_coins) : undefined,
|
||||
price_gold_coins: listing.price_gold_coins
|
||||
? Number(listing.price_gold_coins)
|
||||
: undefined,
|
||||
server_name: listing.server_name,
|
||||
listing_status: listing.listing_status,
|
||||
},
|
||||
@@ -136,4 +140,3 @@ export async function createSystemMessageInChat(
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user