More models organization
This commit is contained in:
@@ -18,7 +18,7 @@ import { CommerceService } from "./services/commerce";
|
||||
import cluster from "node:cluster";
|
||||
import { randomUUIDv7 } from "bun";
|
||||
import { CalculatorService } from "./services/calculator";
|
||||
import { StandardsParametersSchema } from "@blade-and-brawn/calculator";
|
||||
import { StandardsParamsSchema } from "@blade-and-brawn/calculator";
|
||||
|
||||
// SERVICES
|
||||
// -----------
|
||||
@@ -117,16 +117,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: { datasetId, parameters } }) => {
|
||||
.put("/config/:id", async ({ params: { id }, body: { datasetId, params: parameters } }) => {
|
||||
await s.Calculator.Standards.Config.update(id, datasetId, parameters);
|
||||
}, {
|
||||
params: t.Object({ id: t.String() }),
|
||||
body: t.Object({ datasetId: t.String(), parameters: StandardsParametersSchema })
|
||||
body: t.Object({ datasetId: t.String(), params: StandardsParamsSchema })
|
||||
})
|
||||
.post("/config", async ({ body: { datasetId, parameters } }) => {
|
||||
await s.Calculator.Standards.Config.create(datasetId, parameters);
|
||||
.post("/config", async ({ body: { datasetId, params } }) => {
|
||||
await s.Calculator.Standards.Config.create(datasetId, params);
|
||||
}, {
|
||||
body: t.Object({ datasetId: t.String(), parameters: StandardsParametersSchema })
|
||||
body: t.Object({ datasetId: t.String(), params: StandardsParamsSchema })
|
||||
})
|
||||
.post("/config/:id/switch", async ({ params: { id } }) => {
|
||||
await s.Calculator.Standards.Config.switch(id);
|
||||
|
||||
Reference in New Issue
Block a user