mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-13 00:16:39 +00:00
Fix resource new id number
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 || "",
|
||||
|
||||
Reference in New Issue
Block a user