wer
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import { createHonoRoute } from "../../../util/import.ts";
|
||||
|
||||
export const route = createHonoRoute("/messages");
|
||||
export const route = createHonoRoute("/messages");
|
||||
|
||||
route.app.get('/v2/get', c => {
|
||||
return c.json([]);
|
||||
});
|
||||
@@ -1,7 +1,17 @@
|
||||
import z from "zod";
|
||||
import { createHonoRoute } from "../../../util/import.ts";
|
||||
import { authenticate } from "../../../util/api.ts";
|
||||
import { typedZValidator } from "../../../util/validators.ts";
|
||||
|
||||
export const route = createHonoRoute("/players");
|
||||
|
||||
route.app.get('/v2/progression/bulk', c => {
|
||||
return c.json([]); // todo: progression
|
||||
});
|
||||
|
||||
const getProgParamSchema = z.object({
|
||||
id: z.coerce.number()
|
||||
});
|
||||
route.app.get('/v1/progression/:id', authenticate, typedZValidator('param', getProgParamSchema), async c => {
|
||||
return c.json(await c.get('profile').Reputation.export());
|
||||
});
|
||||
@@ -1,8 +1,7 @@
|
||||
import z from "zod";
|
||||
import { authenticate, genericResponse } from "../../../util/api.ts";
|
||||
import { createHonoRoute } from "../../../util/import.ts";
|
||||
import { transformStringToEnum, typedZValidator } from "../../../util/validators.ts";
|
||||
import { ProfileSetting } from "../../../server/profiles/content/Settings.ts";
|
||||
import { typedZValidator } from "../../../util/validators.ts";
|
||||
import { HonoEnv } from "../../../util/types.ts";
|
||||
import { Context } from "@hono/hono";
|
||||
|
||||
@@ -19,7 +18,7 @@ route.app.get('/v2/', getSettingsMiddleware);
|
||||
route.app.get('/v2', getSettingsMiddleware);
|
||||
|
||||
const settingsSetSchema = z.object({
|
||||
Key: z.string().transform(transformStringToEnum<ProfileSetting>(ProfileSetting, true)),
|
||||
Key: z.string(),
|
||||
Value: z.string()
|
||||
});
|
||||
route.app.post('/v2/set', typedZValidator('json', settingsSetSchema), async c => {
|
||||
|
||||
Reference in New Issue
Block a user