From 928bc2f15e03af433a830b8e2522d36a904a92b2 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Tue, 7 Jan 2025 10:22:40 +0100 Subject: [PATCH] fix: route `/containers/:name` should be `/containers/:id` --- src/routes/containers/{_name.ts => _id.ts} | 2 +- src/types/Container.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) rename src/routes/containers/{_name.ts => _id.ts} (87%) diff --git a/src/routes/containers/_name.ts b/src/routes/containers/_id.ts similarity index 87% rename from src/routes/containers/_name.ts rename to src/routes/containers/_id.ts index b65664f..b721f83 100644 --- a/src/routes/containers/_name.ts +++ b/src/routes/containers/_id.ts @@ -4,6 +4,6 @@ import type { FastifyInstance, FastifyRequest } from "fastify"; export default (fastify: FastifyInstance) => { fastify.get("/", (req: FastifyRequest<{ Params: Container }>) => { - return inspectContainer(req.params.name); + return inspectContainer(req.params.id); }); }; diff --git a/src/types/Container.ts b/src/types/Container.ts index c4ae786..db6273d 100644 --- a/src/types/Container.ts +++ b/src/types/Container.ts @@ -1,4 +1,5 @@ export interface Container { + id: string; name: string; image: string; }