refactor: reorganize hooks and add safety checks
fix(api): add validation for listing and seller in bid route feat(telemetry): add userId to MarketTelemetry style(globe): add null check for canvas element chore: add lint:fix script to package.json
This commit is contained in:
1 parent
47c04de6fe
commit
6adc8d96e8
12 files changed
+119
-89
No files matched your search
@@ -123,7 +123,7 @@ export async function generateItemStructure(
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"x-goog-api-key": apiKey,
|
||||
...(apiKey ? { "x-goog-api-key": apiKey } : {}),
|
||||
},
|
||||
body: JSON.stringify({
|
||||
contents: [
|
||||
@@ -258,3 +258,4 @@ Instruções:
|
||||
- Garante que o JSON seja minuciosamente válido.
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Singleton pattern para reutilizar conexão
|
||||
*/
|
||||
|
||||
import type mongoose from "mongoose";
|
||||
import mongoose from "mongoose";
|
||||
|
||||
function getMongoUrl(): string {
|
||||
const url = process.env.MONGO_URL;
|
||||
|
||||
@@ -34,6 +34,7 @@ interface PendingEvent extends TelemetryEvent {
|
||||
|
||||
export class MarketTelemetry {
|
||||
private sessionId: string;
|
||||
private userId?: number;
|
||||
private eventQueue: PendingEvent[] = [];
|
||||
private viewStartTimes: Map<number, number> = new Map();
|
||||
private batchInterval: NodeJS.Timeout | null = null;
|
||||
|
||||
Reference in new issue
Block a user