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

//#region src/routes/tags.routes.ts
const tagRouter = Router();
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"
	}
});
tagRouter.get(getTagRoutes().getTags.urlModel, getTags);
tagRouter.post(getTagRoutes().addTag.urlModel, addTag);
tagRouter.put(getTagRoutes().updateTag.urlModel, updateTag);
tagRouter.delete(getTagRoutes().deleteTag.urlModel, deleteTag);

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