import { addTag, deleteTag, getTags, updateTag } from "../controllers/tag.controller.mjs";

//#region src/routes/tags.routes.ts
const tagRoute = "/api/tag";
const baseURL = () => `${process.env.BACKEND_URL}${tagRoute}`;
const getTagRoutes = () => ({
	getTags: {
		urlModel: "/",
		url: baseURL(),
		method: "GET"
	},
	addTag: {
		urlModel: "/",
		url: baseURL(),
		method: "POST"
	},
	updateTag: {
		urlModel: "/:tagId",
		url: ({ tagId }) => `${baseURL()}/${tagId}`,
		method: "PUT"
	},
	deleteTag: {
		urlModel: "/:tagId",
		url: ({ tagId }) => `${baseURL()}/${tagId}`,
		method: "DELETE"
	}
});
const tagRouter = async (fastify) => {
	fastify.get(getTagRoutes().getTags.urlModel, getTags);
	fastify.post(getTagRoutes().addTag.urlModel, addTag);
	fastify.put(getTagRoutes().updateTag.urlModel, updateTag);
	fastify.delete(getTagRoutes().deleteTag.urlModel, deleteTag);
};

//#endregion
export { getTagRoutes, tagRoute, tagRouter };
//# sourceMappingURL=tags.routes.mjs.map