Fix resource new id number

This commit is contained in:
Owen Schwartz
2024-10-26 12:15:03 -04:00
parent c6d4c4db20
commit 261b3c7e31
19 changed files with 31 additions and 28 deletions

View File

@@ -22,7 +22,7 @@ export const metadata: Metadata = {
interface SettingsLayoutProps {
children: React.ReactNode;
params: Promise<{ resourceId: string; orgId: string }>;
params: Promise<{ resourceId: number | string; orgId: string }>;
}
export default async function SettingsLayout(props: SettingsLayoutProps) {

View File

@@ -5,7 +5,7 @@ import { GeneralForm } from "./components/GeneralForm";
export default async function SettingsPage(
props: {
params: Promise<{ resourceId: string }>;
params: Promise<{ resourceId: number | string }>;
}
) {
const params = await props.params;

View File

@@ -27,7 +27,7 @@ const isValidIPAddress = (ip: string) => {
export default function ReverseProxyTargets(
props: {
params: Promise<{ resourceId: string }>;
params: Promise<{ resourceId: number }>;
}
) {
const params = use(props.params);

View File

@@ -15,7 +15,7 @@ import { useRouter } from "next/navigation";
import api from "@app/api";
export type ResourceRow = {
id: string;
id: number;
name: string;
orgId: string;
domain: string;
@@ -66,7 +66,7 @@ export const columns: ColumnDef<ResourceRow>[] = [
const resourceRow = row.original;
const deleteResource = (resourceId: string) => {
const deleteResource = (resourceId: number) => {
api.delete(`/resource/${resourceId}`)
.catch((e) => {
console.error("Error deleting resource", e);

View File

@@ -23,7 +23,7 @@ export default async function Page(props: ResourcesPageProps) {
const resourceRows: ResourceRow[] = resources.map((resource) => {
return {
id: resource.resourceId.toString(),
id: resource.resourceId,
name: resource.name,
orgId: params.orgId,
domain: resource.subdomain || "",