feat(catalog): fix catalog mode toggles, cart persistence, preorder btn, and dashboard visibility controls
This commit is contained in:
1 parent
aa5b35eff8
commit
01b4ae8aa5
239 files changed
+279927
-126421
No files matched your search
@@ -26,13 +26,17 @@ import {
|
||||
} from '@nestjs/swagger';
|
||||
|
||||
import { CreateUserDto, UpdateUserDto } from './dto/user.dto';
|
||||
import { SettingsService } from '../settings/settings.service';
|
||||
|
||||
@ApiTags('Admin - مدیریت سیستم')
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Controller('admin')
|
||||
export class AdminController {
|
||||
constructor(private readonly adminService: AdminService) {}
|
||||
constructor(
|
||||
private readonly adminService: AdminService,
|
||||
private readonly settingsService: SettingsService,
|
||||
) {}
|
||||
|
||||
@Get('dashboard/stats')
|
||||
@ApiOperation({ summary: 'داشبورد مدیریت و آمار کلیدی سیستم' })
|
||||
@@ -320,14 +324,18 @@ export class AdminController {
|
||||
@Get('settings')
|
||||
@ApiOperation({ summary: 'دریافت تنظیمات کلی سیستم' })
|
||||
async getSettings() {
|
||||
const data = await this.adminService.getSettings();
|
||||
return { success: true, data };
|
||||
const data = await this.settingsService.getUiTexts();
|
||||
const map: Record<string, string> = {};
|
||||
data.forEach((item) => {
|
||||
map[item.key] = item.value;
|
||||
});
|
||||
return { success: true, data: map };
|
||||
}
|
||||
|
||||
@Put('settings')
|
||||
@ApiOperation({ summary: 'بروزرسانی تنظیمات کلی سیستم' })
|
||||
async updateSettings(@Body() body: Record<string, string>) {
|
||||
const data = await this.adminService.updateSettings(body);
|
||||
return { success: true, data };
|
||||
await this.settingsService.updateBulkUiTexts(body);
|
||||
return { success: true, data: body };
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user