removed unneccesary files
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
getUserMidnight,
|
||||
getUserMidnightFromDateOnly,
|
||||
} from "../allocator.js";
|
||||
import { getUserTimezone } from "../services/user-context.js";
|
||||
|
||||
type RateLimitRouteOptions = {
|
||||
config: {
|
||||
@@ -90,9 +91,7 @@ const fixedPlansRoutes: FastifyPluginAsync<FixedPlansRoutesOptions> = async (
|
||||
if (!plan) {
|
||||
return reply.code(404).send({ message: "Plan not found" });
|
||||
}
|
||||
const userTimezone =
|
||||
(await app.prisma.user.findUnique({ where: { id: userId }, select: { timezone: true } }))?.timezone ??
|
||||
"America/New_York";
|
||||
const userTimezone = await getUserTimezone(app.prisma, userId);
|
||||
|
||||
await app.prisma.fixedPlan.update({
|
||||
where: { id: planId },
|
||||
@@ -662,9 +661,7 @@ const fixedPlansRoutes: FastifyPluginAsync<FixedPlansRoutesOptions> = async (
|
||||
return reply.code(400).send({ message: "Invalid payload" });
|
||||
}
|
||||
const userId = req.userId;
|
||||
const userTimezone =
|
||||
(await app.prisma.user.findUnique({ where: { id: userId }, select: { timezone: true } }))?.timezone ??
|
||||
"America/New_York";
|
||||
const userTimezone = await getUserTimezone(app.prisma, userId);
|
||||
|
||||
const amountMode = parsed.data.amountMode ?? "fixed";
|
||||
if (amountMode === "estimated" && parsed.data.estimatedCents === undefined) {
|
||||
@@ -751,9 +748,7 @@ const fixedPlansRoutes: FastifyPluginAsync<FixedPlansRoutesOptions> = async (
|
||||
}
|
||||
const id = String((req.params as any).id);
|
||||
const userId = req.userId;
|
||||
const userTimezone =
|
||||
(await app.prisma.user.findUnique({ where: { id: userId }, select: { timezone: true } }))?.timezone ??
|
||||
"America/New_York";
|
||||
const userTimezone = await getUserTimezone(app.prisma, userId);
|
||||
|
||||
const plan = await app.prisma.fixedPlan.findFirst({
|
||||
where: { id, userId },
|
||||
|
||||
Reference in New Issue
Block a user