mirror of
https://github.com/massbug/judge4c.git
synced 2025-07-17 01:23:53 +00:00
- 在编辑题目描述和解析面板中添加语言切换功能 - 实现获取题目支持的语言列表和对应语言的题目数据 - 增加添加新语言的功能(仅前端) -优化题目描述和解析的编辑、预览和对比功能 - 在预览中添加 Accordion 和 VideoEmbed 组件支持
15 lines
379 B
TypeScript
15 lines
379 B
TypeScript
// src/app/actions/getProblemLocales.ts
|
|
'use server';
|
|
|
|
import prisma from "@/lib/prisma";
|
|
|
|
export async function getProblemLocales(problemId: string): Promise<string[]> {
|
|
const locales = await prisma.problemLocalization.findMany({
|
|
where: { problemId },
|
|
select: { locale: true },
|
|
distinct: ['locale'],
|
|
});
|
|
|
|
return locales.map(l => l.locale);
|
|
}
|