Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hhassan01 committed Aug 30, 2024
1 parent bc8291f commit 3d111b5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/models/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Schema, Document, model, Types } from 'mongoose'

import { TransactionType } from '../constants/transactionType'

export interface ITransaction extends Document {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/validateDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function validateDto<T extends object>(

throw new BadRequestException(
JSON.stringify({
message: 'Validation failed',
message: 'Validation Error',
errors: formattedErrors,
}),
)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/validationMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const validationMiddleware = <T extends object>(
return {
statusCode: 400,
body: JSON.stringify({
message: 'Validation failed',
message: 'Validation Error',
errors: formattedErrors,
}),
}
Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/createAccount.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('createAccountHandler', () => {
const body = JSON.parse(result.body)

expect(result.statusCode).toBe(400)
expect(body.message).toBe('Validation failed')
expect(body.message).toBe('Validation Error')
})

it('should return 409 status when duplicate account is created', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/createTransactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('createTransactionHandler', () => {
const body = JSON.parse(result.body)

expect(result.statusCode).toBe(400)
expect(body.message).toBe('Validation failed')
expect(body.message).toBe('Validation Error')
})

it('should return 404 if the account is not found', async () => {
Expand Down

0 comments on commit 3d111b5

Please sign in to comment.