chore(workspace): eradicate all tsc errors and eslint warnings across frontend, admin, and backend
Deploy Canina / deploy (push) Failing after 29s
Deploy Canina / deploy (push) Failing after 29s
This commit is contained in:
1 parent
4659a7b1de
commit
9f11d8fb2d
98 files changed
+1272
-1009
No files matched your search
@@ -8,7 +8,8 @@ import {
|
||||
Param,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { SettingsService, ScientificTermData } from './settings.service';
|
||||
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||
import { RolesGuard } from '../common/guards/roles.guard';
|
||||
import { Roles } from '../common/decorators/roles.decorator';
|
||||
@@ -29,7 +30,8 @@ export class SettingsController {
|
||||
@Get('ui-texts')
|
||||
@ApiOperation({ summary: 'دریافت تمامی متون و پیکربندیهای رابط کاربری' })
|
||||
@ApiOkResponse({
|
||||
description: 'یک آبجکت کلید-مقدار حاوی تمامی متون، شعارها و برچسبهای دکمهها',
|
||||
description:
|
||||
'یک آبجکت کلید-مقدار حاوی تمامی متون، شعارها و برچسبهای دکمهها',
|
||||
})
|
||||
getUiTexts() {
|
||||
return this.settingsService.getUiTexts();
|
||||
@@ -53,7 +55,10 @@ export class SettingsController {
|
||||
@ApiBearerAuth()
|
||||
@Put('scientific-terms/:key')
|
||||
@ApiOperation({ summary: 'ثبت یا ویرایش یک اصطلاح علمی' })
|
||||
upsertScientificTerm(@Param('key') key: string, @Body() data: any) {
|
||||
upsertScientificTerm(
|
||||
@Param('key') key: string,
|
||||
@Body() data: ScientificTermData,
|
||||
) {
|
||||
return this.settingsService.upsertScientificTerm(key, data);
|
||||
}
|
||||
|
||||
@@ -74,7 +79,7 @@ export class SettingsController {
|
||||
|
||||
@Patch('seo')
|
||||
@ApiOperation({ summary: 'بهروزرسانی تنظیمات سئو' })
|
||||
updateSeoSettings(@Body() body: any) {
|
||||
updateSeoSettings(@Body() body: Prisma.InputJsonValue) {
|
||||
return this.settingsService.updateCategorySetting('seo', body);
|
||||
}
|
||||
|
||||
@@ -87,7 +92,7 @@ export class SettingsController {
|
||||
|
||||
@Patch('financial')
|
||||
@ApiOperation({ summary: 'بهروزرسانی تنظیمات مالی' })
|
||||
updateFinancialSettings(@Body() body: any) {
|
||||
updateFinancialSettings(@Body() body: Prisma.InputJsonValue) {
|
||||
return this.settingsService.updateCategorySetting('financial', body);
|
||||
}
|
||||
|
||||
@@ -100,7 +105,7 @@ export class SettingsController {
|
||||
|
||||
@Patch('system')
|
||||
@ApiOperation({ summary: 'بهروزرسانی تنظیمات سیستم' })
|
||||
updateSystemSettings(@Body() body: any) {
|
||||
updateSystemSettings(@Body() body: Prisma.InputJsonValue) {
|
||||
return this.settingsService.updateCategorySetting('system', body);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,13 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
|
||||
export class ScientificTermData {
|
||||
term?: string;
|
||||
definition?: string;
|
||||
wikiId?: string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class SettingsService {
|
||||
constructor(private prisma: PrismaService) {}
|
||||
@@ -21,7 +28,7 @@ export class SettingsService {
|
||||
return this.prisma.scientificTerm.findMany();
|
||||
}
|
||||
|
||||
async upsertScientificTerm(key: string, data: any) {
|
||||
async upsertScientificTerm(key: string, data: ScientificTermData) {
|
||||
const term = String(data?.term || '');
|
||||
const definition = String(data?.definition || '');
|
||||
const wikiId = String(data?.wikiId || 'general');
|
||||
@@ -55,7 +62,7 @@ export class SettingsService {
|
||||
return setting ? setting.value : {};
|
||||
}
|
||||
|
||||
async updateCategorySetting(category: string, value: any) {
|
||||
async updateCategorySetting(category: string, value: Prisma.InputJsonValue) {
|
||||
const key = `${category}_config`;
|
||||
return this.prisma.setting.upsert({
|
||||
where: { key },
|
||||
|
||||
Reference in new issue
Block a user