app-template/packages/trpc/src/router/settings.router.ts

15 lines
646 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { settingsSchemas } from "@app/types";
import { adminProcedure } from "../services/procedure.js";
import { settingsService } from "../services/settings.service.js";
import { t } from "../context.js";
export const settingsRouter = t.router({
/** 开放弹幕网络(仅管理员;secret 明文) */
getOpenNetwork: adminProcedure
.input(settingsSchemas.getOpenNetwork)
.query(() => settingsService.getOpenNetworkSettings()),
saveOpenNetwork: adminProcedure
.input(settingsSchemas.saveOpenNetwork)
.mutation(({ ctx, input }) => settingsService.saveOpenNetworkSettings(ctx.userId, input)),
});