Skip to content

Commit

Permalink
fix: remove escape characters
Browse files Browse the repository at this point in the history
  • Loading branch information
dagmawig committed Jan 25, 2022
1 parent 0371df4 commit 064b871
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions server/infra/database/BaseRepository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('BaseRepository', () => {
expect(entity).toHaveProperty('id', 1)
})

//TODO
// TODO
it.skip('getById can not find result, should throw 404', () => {});

describe.only('getByFilter', () => {
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('BaseRepository', () => {
tracker.uninstall()
tracker.install()
tracker.on('query', (query) => {
expect(query.sql).toMatch('select * from "testTable" where \("name" \= $1\) order by "id" desc'
expect(query.sql).toMatch('select * from "testTable" where ("name" = $1) order by "id" desc'
)
query.response([{ id: 1 }])
})
Expand All @@ -93,7 +93,7 @@ describe('BaseRepository', () => {
tracker.uninstall()
tracker.install()
tracker.on('query', (query) => {
expect(query.sql).toMatch('select * from "testTable" where \("name" \= $1\)'
expect(query.sql).toMatch('select * from "testTable" where ("name" = $1)'
)
query.response([{ id: 1 }])
})
Expand Down Expand Up @@ -309,7 +309,7 @@ describe('BaseRepository', () => {
expect(result).toBe(1)
})

//TODO
// TODO
describe.skip('count support and and or', () => {});
});
});
2 changes: 1 addition & 1 deletion server/infra/database/BaseRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class BaseRepository<T> {
promise = promise.limit(options && options.limit)
}
if (options && options.orderBy) {
let direction = (options.orderBy.direction !== undefined) ? options.orderBy.direction : 'asc';
const direction = (options.orderBy.direction !== undefined) ? options.orderBy.direction : 'asc';
promise = promise.orderBy(options.orderBy.column, direction)
}
const result = await promise;
Expand Down

0 comments on commit 064b871

Please sign in to comment.