mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 15:50:32 +00:00
refactor: nestjs
This commit is contained in:
@@ -17,9 +17,11 @@ import {
|
|||||||
import { GetCurrentOrganizationService } from './queries/GetCurrentOrganization.service';
|
import { GetCurrentOrganizationService } from './queries/GetCurrentOrganization.service';
|
||||||
import { UpdateOrganizationService } from './commands/UpdateOrganization.service';
|
import { UpdateOrganizationService } from './commands/UpdateOrganization.service';
|
||||||
import { ApiTags, ApiOperation, ApiResponse, ApiBody } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiResponse, ApiBody } from '@nestjs/swagger';
|
||||||
|
import { PublicRoute } from '../Auth/Jwt.guard';
|
||||||
|
|
||||||
@ApiTags('Organization')
|
@ApiTags('Organization')
|
||||||
@Controller('organization')
|
@Controller('organization')
|
||||||
|
@PublicRoute()
|
||||||
export class OrganizationController {
|
export class OrganizationController {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly buildOrganizationService: BuildOrganizationService,
|
private readonly buildOrganizationService: BuildOrganizationService,
|
||||||
@@ -80,6 +82,7 @@ export class OrganizationController {
|
|||||||
await this.updateOrganizationService.execute(updateDTO);
|
await this.updateOrganizationService.execute(updateDTO);
|
||||||
|
|
||||||
return res.status(200).send({
|
return res.status(200).send({
|
||||||
|
code: 200,
|
||||||
message: 'Organization information has been updated successfully.',
|
message: 'Organization information has been updated successfully.',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,10 +22,11 @@ import {
|
|||||||
ApiParam,
|
ApiParam,
|
||||||
ApiBody,
|
ApiBody,
|
||||||
} from '@nestjs/swagger';
|
} from '@nestjs/swagger';
|
||||||
|
import { PublicRoute } from '../Auth/Jwt.guard';
|
||||||
|
|
||||||
@ApiTags('Roles')
|
@ApiTags('Roles')
|
||||||
@Controller('roles')
|
@Controller('roles')
|
||||||
@Injectable()
|
@PublicRoute()
|
||||||
export class RolesController {
|
export class RolesController {
|
||||||
constructor(private readonly rolesApp: RolesApplication) {}
|
constructor(private readonly rolesApp: RolesApplication) {}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export class Role extends TenantBaseModel {
|
|||||||
* Relationship mapping.
|
* Relationship mapping.
|
||||||
*/
|
*/
|
||||||
static get relationMappings() {
|
static get relationMappings() {
|
||||||
const { RolePermission } = require('./RolePermission');
|
const { RolePermission } = require('./RolePermission.model');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user