Initial Mento CRM: portal OTP, reports, SMS, and deploy for crm.montzar.ir.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { Body, Controller, Get, Patch, UseGuards } from '@nestjs/common';
|
||||
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||
import { RolesGuard } from '../auth/roles.guard';
|
||||
import { Roles } from '../auth/roles.decorator';
|
||||
import { CurrentUser } from '../auth/current-user.decorator';
|
||||
import { UpdateOrgCurrenciesDto } from './dto';
|
||||
import { OrganizationsService } from './organizations.service';
|
||||
|
||||
@Controller('organizations')
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
export class OrganizationsController {
|
||||
constructor(private readonly organizationsService: OrganizationsService) {}
|
||||
|
||||
@Get('current')
|
||||
current(@CurrentUser() user: { organizationId: string }) {
|
||||
return this.organizationsService.getCurrent(user.organizationId);
|
||||
}
|
||||
|
||||
@Get('currency-catalog')
|
||||
catalog() {
|
||||
return this.organizationsService.catalog();
|
||||
}
|
||||
|
||||
@Patch('current/currencies')
|
||||
@Roles('owner', 'admin')
|
||||
updateCurrencies(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Body() dto: UpdateOrgCurrenciesDto,
|
||||
) {
|
||||
return this.organizationsService.updateCurrencies(
|
||||
user.organizationId,
|
||||
dto,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user