Spaces:
Running
Running
Bibhu Mishra
Claude Sonnet 4.6
Add GitHub Actions CI/CD, HF Space deployment, market hours guard, and static serving
abc493d Download api/src/settings/settings.controller.ts from mishrabp/stockadvisor: direct link, hf CLI and curl.
- Browser
- Download file 608 Bytes
-
https://huggingface.co/spaces/mishrabp/stockadvisor/resolve/main/api/src/settings/settings.controller.ts
- Command line
-
hf download hf://spaces/mishrabp/stockadvisor/api/src/settings/settings.controller.ts
-
curl -L -o settings.controller.ts https://huggingface.co/spaces/mishrabp/stockadvisor/resolve/main/api/src/settings/settings.controller.ts
608 Bytes
| import { Body, Controller, ForbiddenException, Get, Patch, Request, UseGuards } from '@nestjs/common'; | |
| import { JwtAuthGuard } from '../auth/jwt-auth.guard'; | |
| import { SettingsService } from './settings.service'; | |
| ('settings') | |
| (JwtAuthGuard) | |
| export class SettingsController { | |
| constructor(private svc: SettingsService) {} | |
| () | |
| findAll() { return this.svc.findAll(); } | |
| () | |
| update(() body: Record<string, string>, () req: { user: { role: string } }) { | |
| if (req.user.role !== 'admin') throw new ForbiddenException(); | |
| return this.svc.update(body); | |
| } | |
| } | |