PIT: Add folder reconstruction functions

This commit is contained in:
carlosmonastyrski
2025-05-09 09:20:17 -03:00
parent e8d424bbb0
commit 78d5bc823d
6 changed files with 397 additions and 44 deletions
+27
View File
@@ -0,0 +1,27 @@
import { z } from "zod";
import { readLimit } from "@app/server/config/rateLimiter";
export const registerPITRouter = async (server: FastifyZodProvider) => {
server.route({
method: "GET",
url: "/diff",
config: {
rateLimit: readLimit
},
schema: {
querystring: z.object({
fromCommit: z.string().trim(),
toCommit: z.string().trim()
}),
response: {
200: z.any()
}
},
handler: async (req) => {
const backup = await server.services.folderCommit.compareFolderStates(req.query.fromCommit, req.query.toCommit);
return backup;
}
});
};