diff --git a/src/activity/activity.service.ts b/src/activity/activity.service.ts index f91839d..0ae8db5 100644 --- a/src/activity/activity.service.ts +++ b/src/activity/activity.service.ts @@ -1184,7 +1184,7 @@ ORDER BY queryBuilder.andWhere( new Brackets((qb) => { actionsArray.forEach((action, index) => { - qb.orWhere(`activity.action LIKE :action${index}`, { [`action${index}`]: `%${action}%` }); + qb.orWhere(`activity.action = :action${index}`, { [`action${index}`]: `${action}` }); }); }), ); diff --git a/src/v1/activity/activity.controller.ts b/src/v1/activity/activity.controller.ts index 420d333..6482473 100644 --- a/src/v1/activity/activity.controller.ts +++ b/src/v1/activity/activity.controller.ts @@ -16,6 +16,9 @@ export class ActivityController { } private formatAction(action: string): string { + if (action.includes('edit_deposit_withdraw')) return 'editDepositWithdraw'; + if (action.includes('edit_deposit')) return 'editDeposit'; + if (action.includes('edit_withdraw')) return 'editWithdraw'; if (action.includes('sell')) return 'sell'; if (action.includes('buy')) return 'buy'; if (action.includes('create')) return 'create'; @@ -25,6 +28,7 @@ export class ActivityController { if (action.includes('edit')) return 'edit'; if (action.includes('delete')) return 'delete'; if (action.includes('pause')) return 'pause'; + return ''; } diff --git a/src/v1/activity/activity.dto.ts b/src/v1/activity/activity.dto.ts index 3a237c3..be454ca 100644 --- a/src/v1/activity/activity.dto.ts +++ b/src/v1/activity/activity.dto.ts @@ -3,7 +3,20 @@ import { formatEthereumAddress } from '../../isAddress.validator'; import { Transform } from 'class-transformer'; import { ApiPropertyOptional } from '@nestjs/swagger'; -export const validActions = ['sell', 'buy', 'create', 'deposit', 'withdraw', 'transfer', 'edit', 'delete', 'pause']; +export const validActions = [ + 'sell', + 'buy', + 'create', + 'deposit', + 'withdraw', + 'transfer', + 'edit', + 'delete', + 'pause', + 'edit_deposit', + 'edit_withdraw', + 'edit_deposit_withdraw', +]; export class ActivityDto { @IsOptional()