admin and back fixes
This commit is contained in:
parent
eb13424f20
commit
18ca477ef1
5 changed files with 4 additions and 15 deletions
|
|
@ -29,11 +29,7 @@ function ensureQuestionIds(questions: Question[]): Question[] {
|
|||
id: answer.id || randomUUID(),
|
||||
}));
|
||||
|
||||
// Удаляем поле question если оно было в исходном объекте
|
||||
const { question: _, ...questionWithoutQuestion } = question;
|
||||
|
||||
return {
|
||||
...questionWithoutQuestion,
|
||||
id: questionId,
|
||||
text: questionText,
|
||||
answers: answersWithIds,
|
||||
|
|
@ -405,7 +401,6 @@ async function main() {
|
|||
where: { id: theme.id },
|
||||
update: {
|
||||
name: theme.name,
|
||||
icon: theme.icon,
|
||||
description: theme.description,
|
||||
isPublic: theme.isPublic,
|
||||
colors: theme.colors as any,
|
||||
|
|
@ -414,7 +409,6 @@ async function main() {
|
|||
create: {
|
||||
id: theme.id,
|
||||
name: theme.name,
|
||||
icon: theme.icon,
|
||||
description: theme.description,
|
||||
isPublic: theme.isPublic,
|
||||
createdBy: demoUser.id,
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ export class AdminPacksService {
|
|||
throw new NotFoundException('Question pack not found');
|
||||
}
|
||||
|
||||
// Нормализуем вопросы при экспорте, удаляя поле question если оно есть
|
||||
// Нормализуем вопросы при экспорте, добавляя UUID если их нет
|
||||
const packQuestions = Array.isArray(pack.questions) ? pack.questions as any[] : [];
|
||||
const normalizedQuestions = ensureQuestionIds(packQuestions);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ export class AdminThemesService {
|
|||
skip,
|
||||
take: limit,
|
||||
select: {
|
||||
icon: true,
|
||||
id: true,
|
||||
name: true,
|
||||
icon: true,
|
||||
description: true,
|
||||
isPublic: true,
|
||||
colors: true,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { randomUUID } from 'crypto';
|
||||
|
||||
interface Answer {
|
||||
export interface Answer {
|
||||
id?: string;
|
||||
text: string;
|
||||
points: number;
|
||||
}
|
||||
|
||||
interface Question {
|
||||
export interface Question {
|
||||
id?: string;
|
||||
text?: string;
|
||||
answers: Answer[];
|
||||
|
|
@ -44,11 +44,7 @@ export function ensureQuestionIds(questions: Question[]): Question[] {
|
|||
};
|
||||
});
|
||||
|
||||
// Удаляем поле question если оно было в исходном объекте
|
||||
const { question: _, ...questionWithoutQuestion } = question;
|
||||
|
||||
return {
|
||||
...questionWithoutQuestion,
|
||||
id: questionId,
|
||||
text: questionText,
|
||||
answers: answersWithIds,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ const GameManagementModal = ({
|
|||
onToggleParticles,
|
||||
initialTab = 'players',
|
||||
onAddPlayer,
|
||||
room,
|
||||
}) => {
|
||||
const { currentThemeData } = useTheme()
|
||||
const [activeTab, setActiveTab] = useState(initialTab) // players | game | scoring | questions
|
||||
|
|
|
|||
Loading…
Reference in a new issue