More refactoring and integration of standards dataset database

This commit is contained in:
Dominic Ferrando
2026-07-04 14:11:13 -04:00
parent 9e1025e119
commit 01878a8e03
7 changed files with 93 additions and 57 deletions
+6 -6
View File
@@ -116,16 +116,16 @@ export const app = new Elysia()
if (!token || !token.sessionId) throw status(401, "Unauthorized");
return { sessionId: token.sessionId.toString() };
})
.put("/config/:id", async ({ params: { id }, body: { standardsConfig } }) => {
await calculatorService.standards.setConfig(id, standardsConfig);
.put("/config/:id", async ({ params: { id }, body: { datasetId, parameters } }) => {
await calculatorService.standards.setConfig(id, datasetId, parameters);
}, {
params: t.Object({ id: t.String() }),
body: t.Object({ standardsConfig: StandardsParametersSchema })
body: t.Object({ datasetId: t.String(), parameters: StandardsParametersSchema })
})
.post("/config", async ({ body: { standardsConfig } }) => {
await calculatorService.standards.createConfig(standardsConfig);
.post("/config", async ({ body: { datasetId, parameters } }) => {
await calculatorService.standards.createConfig(datasetId, parameters);
}, {
body: t.Object({ standardsConfig: StandardsParametersSchema })
body: t.Object({ datasetId: t.String(), parameters: StandardsParametersSchema })
})
.post("/config/:id/select", async ({ params: { id } }) => {
await calculatorService.standards.selectConfig(id);