mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
15 lines
469 B
TypeScript
15 lines
469 B
TypeScript
import { eq } from "drizzle-orm";
|
|||
|
|
import type { FastifyInstance } from "fastify";
|
||
|
|
import { db, schema } from "../db/index.js";
|
||
|
|
|
||
|
|
export async function configRoutes(app: FastifyInstance): Promise<void> {
|
||
|
|
app.get("/api/v1/config/locale", async (_request, reply) => {
|
||
|
|
const row = db
|
||
|
|
.select()
|
||
|
|
.from(schema.settings)
|
||
|
|
.where(eq(schema.settings.key, "defaultLocale"))
|
||
|
|
.get();
|
||
|
|
return reply.send({ defaultLocale: row?.value ?? "en" });
|
||
|
|
});
|
||
|
|
}
|