Deploy to staging #47
			
				
			
		
		
		
	| 
						 | 
					@ -15,6 +15,7 @@ import { AuthorizationMiddleware } from './modules/admins/middlewares/authorizat
 | 
				
			||||||
import { ClientAuthenticationMiddleware } from './modules/auth/middlewares/client-authentication.middleware';
 | 
					import { ClientAuthenticationMiddleware } from './modules/auth/middlewares/client-authentication.middleware';
 | 
				
			||||||
import { NotificationModule } from './modules/notification/notification.module';
 | 
					import { NotificationModule } from './modules/notification/notification.module';
 | 
				
			||||||
import { ScrapsModule } from './modules/scraps/scraps.module';
 | 
					import { ScrapsModule } from './modules/scraps/scraps.module';
 | 
				
			||||||
 | 
					import { ExtensionsModule } from './modules/extensions/extensions.module';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Module({
 | 
					@Module({
 | 
				
			||||||
  imports: [
 | 
					  imports: [
 | 
				
			||||||
| 
						 | 
					@ -26,6 +27,7 @@ import { ScrapsModule } from './modules/scraps/scraps.module';
 | 
				
			||||||
    AdminsModule,
 | 
					    AdminsModule,
 | 
				
			||||||
    NotificationModule,
 | 
					    NotificationModule,
 | 
				
			||||||
    ScrapsModule,
 | 
					    ScrapsModule,
 | 
				
			||||||
 | 
					    ExtensionsModule,
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
  controllers: [],
 | 
					  controllers: [],
 | 
				
			||||||
  providers: [],
 | 
					  providers: [],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,8 +22,6 @@ async function bootstrap() {
 | 
				
			||||||
    ? process.env.CORS.split(',').map((origin) => origin.trim())
 | 
					    ? process.env.CORS.split(',').map((origin) => origin.trim())
 | 
				
			||||||
    : ['*']; // hoặc [] tùy ý bạn
 | 
					    : ['*']; // hoặc [] tùy ý bạn
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    console.log('%csrc/main.ts:26 [...corsOrigins, ...urls]', 'color: #007acc;', [...corsOrigins, ...urls]);
 | 
					 | 
				
			||||||
  app.enableCors({
 | 
					  app.enableCors({
 | 
				
			||||||
    origin: [...corsOrigins, ...urls],
 | 
					    origin: [...corsOrigins, ...urls],
 | 
				
			||||||
    methods: ['GET', 'PUT', 'POST', 'DELETE', 'PATCH'],
 | 
					    methods: ['GET', 'PUT', 'POST', 'DELETE', 'PATCH'],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -554,11 +554,6 @@ export class BidsService {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async getBidByModel(model: string) {
 | 
					  async getBidByModel(model: string) {
 | 
				
			||||||
    console.log(
 | 
					 | 
				
			||||||
      '%csrc/modules/bids/services/bids.service.ts:554 model',
 | 
					 | 
				
			||||||
      'color: #007acc;',
 | 
					 | 
				
			||||||
      model,
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
    const bid = await this.bidsRepo.findOne({ where: { model } });
 | 
					    const bid = await this.bidsRepo.findOne({ where: { model } });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!bid)
 | 
					    if (!bid)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,15 @@
 | 
				
			||||||
 | 
					import { Constant } from '@/modules/bids/utils/constant';
 | 
				
			||||||
 | 
					import { Controller, Get, Res } from '@nestjs/common';
 | 
				
			||||||
 | 
					import { Response } from 'express';
 | 
				
			||||||
 | 
					import { join } from 'path';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Controller('extensions')
 | 
				
			||||||
 | 
					export class ExtensionsController {
 | 
				
			||||||
 | 
					  @Get('policy')
 | 
				
			||||||
 | 
					  async policy(@Res() res: Response) {
 | 
				
			||||||
 | 
					    const rootDir = process.cwd();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const filePath = join(rootDir, `${Constant.MEDIA_PATH}/views/policy.html`);
 | 
				
			||||||
 | 
					    return res.sendFile(filePath);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,7 @@
 | 
				
			||||||
 | 
					import { Module } from '@nestjs/common';
 | 
				
			||||||
 | 
					import { ExtensionsController } from './controllers/extensions.controller';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Module({
 | 
				
			||||||
 | 
					  controllers: [ExtensionsController],
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class ExtensionsModule {}
 | 
				
			||||||
| 
						 | 
					@ -18,6 +18,10 @@ export const clientExcludeAuth = [
 | 
				
			||||||
    path: 'auth/generate-token',
 | 
					    path: 'auth/generate-token',
 | 
				
			||||||
    method: RequestMethod.POST,
 | 
					    method: RequestMethod.POST,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    path: 'extensions/policy',
 | 
				
			||||||
 | 
					    method: RequestMethod.GET,
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
] as (string | RouteInfo)[];
 | 
					] as (string | RouteInfo)[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const excludeAuthor = [
 | 
					export const excludeAuthor = [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue