fix(api/auth): allow public GET on ui-texts & scientific-terms, fix refresh attempt loop, remove duplicate error toasts and prevent unwanted modal popups
Deploy Canina / deploy (push) Failing after 28s
Deploy Canina / deploy (push) Failing after 28s
This commit is contained in:
1 parent
adbfa60343
commit
74b3d24622
6 files changed
+48
-10
No files matched your search
@@ -21,8 +21,6 @@ import {
|
||||
} from '@nestjs/swagger';
|
||||
|
||||
@ApiTags('Settings - تنظیمات متون پویا، تنظیمات سئو، مالی و سیستم')
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@Controller('settings')
|
||||
export class SettingsController {
|
||||
constructor(private readonly settingsService: SettingsService) {}
|
||||
@@ -37,7 +35,8 @@ export class SettingsController {
|
||||
return this.settingsService.getUiTexts();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@ApiBearerAuth()
|
||||
@Patch('ui-texts/:key')
|
||||
@ApiOperation({ summary: 'ویرایش متن یک کلید در رابط کاربری' })
|
||||
@@ -51,7 +50,8 @@ export class SettingsController {
|
||||
return this.settingsService.getScientificTerms();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@ApiBearerAuth()
|
||||
@Put('scientific-terms/:key')
|
||||
@ApiOperation({ summary: 'ثبت یا ویرایش یک اصطلاح علمی' })
|
||||
@@ -62,7 +62,8 @@ export class SettingsController {
|
||||
return this.settingsService.upsertScientificTerm(key, data);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@ApiBearerAuth()
|
||||
@Delete('scientific-terms/:key')
|
||||
@ApiOperation({ summary: 'حذف یک اصطلاح علمی' })
|
||||
@@ -77,6 +78,9 @@ export class SettingsController {
|
||||
return this.settingsService.getCategorySetting('seo');
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@ApiBearerAuth()
|
||||
@Patch('seo')
|
||||
@ApiOperation({ summary: 'بهروزرسانی تنظیمات سئو' })
|
||||
updateSeoSettings(@Body() body: Prisma.InputJsonValue) {
|
||||
@@ -84,12 +88,18 @@ export class SettingsController {
|
||||
}
|
||||
|
||||
// Financial Settings
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@ApiBearerAuth()
|
||||
@Get('financial')
|
||||
@ApiOperation({ summary: 'دریافت تنظیمات مالی' })
|
||||
getFinancialSettings() {
|
||||
return this.settingsService.getCategorySetting('financial');
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@ApiBearerAuth()
|
||||
@Patch('financial')
|
||||
@ApiOperation({ summary: 'بهروزرسانی تنظیمات مالی' })
|
||||
updateFinancialSettings(@Body() body: Prisma.InputJsonValue) {
|
||||
@@ -97,12 +107,18 @@ export class SettingsController {
|
||||
}
|
||||
|
||||
// System Settings
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@ApiBearerAuth()
|
||||
@Get('system')
|
||||
@ApiOperation({ summary: 'دریافت تنظیمات سیستم' })
|
||||
getSystemSettings() {
|
||||
return this.settingsService.getCategorySetting('system');
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@ApiBearerAuth()
|
||||
@Patch('system')
|
||||
@ApiOperation({ summary: 'بهروزرسانی تنظیمات سیستم' })
|
||||
updateSystemSettings(@Body() body: Prisma.InputJsonValue) {
|
||||
|
||||
Reference in new issue
Block a user