chore(root): migrate to biome
This commit is contained in:
@@ -14,7 +14,7 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
req: FastifyRequest<{
|
||||
Body: PostEventPayload;
|
||||
}>,
|
||||
reply
|
||||
reply,
|
||||
) => {
|
||||
try {
|
||||
const client = await validateSdkRequest(req.headers).catch((error) => {
|
||||
@@ -51,7 +51,7 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
reply.status(401).send();
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
fastify.route({
|
||||
|
||||
@@ -15,11 +15,14 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
error: 'Unauthorized',
|
||||
message: 'Client ID seems to be malformed',
|
||||
});
|
||||
} else if (e instanceof Error) {
|
||||
}
|
||||
|
||||
if (e instanceof Error) {
|
||||
return reply
|
||||
.status(401)
|
||||
.send({ error: 'Unauthorized', message: e.message });
|
||||
}
|
||||
|
||||
return reply
|
||||
.status(401)
|
||||
.send({ error: 'Unauthorized', message: 'Unexpected error' });
|
||||
|
||||
@@ -15,11 +15,14 @@ const importRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
error: 'Unauthorized',
|
||||
message: 'Client ID seems to be malformed',
|
||||
});
|
||||
} else if (e instanceof Error) {
|
||||
}
|
||||
|
||||
if (e instanceof Error) {
|
||||
return reply
|
||||
.status(401)
|
||||
.send({ error: 'Unauthorized', message: e.message });
|
||||
}
|
||||
|
||||
return reply
|
||||
.status(401)
|
||||
.send({ error: 'Unauthorized', message: 'Unexpected error' });
|
||||
|
||||
@@ -20,12 +20,12 @@ const liveRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
fastify.get(
|
||||
'/visitors/:projectId',
|
||||
{ websocket: true },
|
||||
controller.wsVisitors
|
||||
controller.wsVisitors,
|
||||
);
|
||||
fastify.get(
|
||||
'/events/:projectId',
|
||||
{ websocket: true },
|
||||
controller.wsProjectEvents
|
||||
controller.wsProjectEvents,
|
||||
);
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ const trackRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
req: FastifyRequest<{
|
||||
Body: TrackHandlerPayload;
|
||||
}>,
|
||||
reply
|
||||
reply,
|
||||
) => {
|
||||
try {
|
||||
const client = await validateSdkRequest(req.headers).catch((error) => {
|
||||
@@ -55,7 +55,7 @@ const trackRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
reply.status(401).send();
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
fastify.route({
|
||||
|
||||
Reference in New Issue
Block a user