From 5bdd1135116a14320f7bcd0f2fec55eb32c594f4 Mon Sep 17 00:00:00 2001 From: Harsh Shrikant Bhat <90265455+harshsbhat@users.noreply.github.com> Date: Sun, 13 Oct 2024 17:43:17 +0530 Subject: [PATCH 1/4] fix: Default Bytes should only allow numbers --- .../dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx b/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx index adbd6b3fc4..5bbf546291 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx @@ -84,7 +84,7 @@ export const DefaultBytes: React.FC = ({ keyAuth }) => { render={({ field }) => ( field.onChange(Number(e.target.value))} /> From bbbb66b377939ecf178c3c3e5266a1c3ae7c031b Mon Sep 17 00:00:00 2001 From: Harsh Shrikant Bhat <90265455+harshsbhat@users.noreply.github.com> Date: Sun, 13 Oct 2024 21:40:03 +0530 Subject: [PATCH 2/4] adding the field back on --- apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx b/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx index 5bbf546291..876e92eda9 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx @@ -85,6 +85,7 @@ export const DefaultBytes: React.FC = ({ keyAuth }) => { field.onChange(Number(e.target.value))} /> From 2a65fb86efd754dcfa6dd181f6c01127b5b162d9 Mon Sep 17 00:00:00 2001 From: Harsh Shrikant Bhat <90265455+harshsbhat@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:15:58 +0530 Subject: [PATCH 3/4] new changes to make sure its not 0number --- .../app/(app)/apis/[apiId]/settings/default-bytes.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx b/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx index 876e92eda9..995d3b6572 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx @@ -71,7 +71,10 @@ export const DefaultBytes: React.FC = ({ keyAuth }) => { Default Bytes - Set default Bytes for the keys under this API. + + Set default Bytes for the keys under this API. Default byte size must be between{" "} + 8 to 255 +
@@ -84,10 +87,9 @@ export const DefaultBytes: React.FC = ({ keyAuth }) => { render={({ field }) => ( field.onChange(Number(e.target.value))} + onChange={(e) => field.onChange(Number(e.target.value.replace(/\D/g, "")))} /> )} /> From dbaba64655d0d36b582abea031f5e11ac344e61e Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:57:12 +0000 Subject: [PATCH 4/4] [autofix.ci] apply automated fixes --- .../app/(app)/ratelimits/[namespaceId]/overrides/page.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/dashboard/app/(app)/ratelimits/[namespaceId]/overrides/page.tsx b/apps/dashboard/app/(app)/ratelimits/[namespaceId]/overrides/page.tsx index 8ebe9e51c7..521dcfdd70 100644 --- a/apps/dashboard/app/(app)/ratelimits/[namespaceId]/overrides/page.tsx +++ b/apps/dashboard/app/(app)/ratelimits/[namespaceId]/overrides/page.tsx @@ -23,10 +23,7 @@ export default async function OverridePage(props: Props) { const namespace = await db.query.ratelimitNamespaces.findFirst({ where: (table, { eq, and, isNull }) => - and( - eq(table.id, props.params.namespaceId), - isNull(table.deletedAt) - ), + and(eq(table.id, props.params.namespaceId), isNull(table.deletedAt)), with: { overrides: { columns: { @@ -36,8 +33,7 @@ export default async function OverridePage(props: Props) { duration: true, async: true, }, - where: (table, { isNull }) => - isNull(table.deletedAt) + where: (table, { isNull }) => isNull(table.deletedAt), }, workspace: { columns: {