Skip to content

Commit

Permalink
Merge pull request #112 from sotatek-dev/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Sotatek-TanHoang authored Sep 30, 2024
2 parents 4c5e8a2 + 76e7f65 commit 6088ac4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
20 changes: 20 additions & 0 deletions DockerfileUAT
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:18-alpine As build
WORKDIR /app

COPY package*.json ./
RUN npm i
COPY . .
RUN npm run build

FROM node:18-alpine
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
# COPY --from=build /app/.env ./.env
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/tsconfig.build.json ./tsconfig.build.json

# RUN apk --no-cache add curl
EXPOSE 3969

#CMD ["sh", "-c", "yarn start"]
1 change: 1 addition & 0 deletions src/constants/error.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export enum EError {
UNAUTHORIZED = 'UNAUTHORIZED',
INVALID_SIGNATURE = 'INVALID_SIGNATURE',
OVER_DAILY_QUOTA = 'OVER_DAILY_QUOTA',
RESOURCE_NOT_FOUND = 'RESOURCE_NOT_FOUND',
}
6 changes: 4 additions & 2 deletions src/modules/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CommonConfigRepository } from '../../database/repositories/common-confi
import { EventLogRepository } from '../../database/repositories/event-log.repository.js';
import { UserRepository } from '../../database/repositories/user.repository.js';
import { TokenPair } from '../../modules/users/entities/tokenpair.entity.js';
import { httpBadRequest } from '../../shared/exceptions/http-exeption.js';
import { httpBadRequest, httpNotFound } from '../../shared/exceptions/http-exeption.js';
import { LoggerService } from '../../shared/modules/logger/logger.service.js';
import { addDecimal } from '../../shared/utils/bignumber.js';
import { UpdateCommonConfigBodyDto } from './dto/common-config-request.dto.js';
Expand Down Expand Up @@ -79,7 +79,9 @@ export class UsersService {
}),
this.commonConfigRepository.getCommonConfig(),
]);

if (!tokenPair) {
httpNotFound(EError.RESOURCE_NOT_FOUND);
}
if (tokenPair.toChain == ENetworkName.MINA) {
decimal = this.configService.get(EEnvKey.DECIMAL_TOKEN_EVM);
gasFee = addDecimal(this.configService.get(EEnvKey.GAS_FEE_EVM), decimal);
Expand Down

0 comments on commit 6088ac4

Please sign in to comment.