mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-07-06 11:01:56 +00:00
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);
|
||
|
}
|