xcally-nest-library 0.0.9 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- package/.nvmrc +1 -1
- package/dist/src/config/env.validation.d.ts +2 -1
- package/dist/src/config/env.validation.js +1 -0
- package/dist/src/config/env.validation.js.map +1 -1
- package/dist/src/db/typeorm/generic.repository.d.ts +1 -0
- package/dist/src/db/typeorm/generic.repository.js +4 -5
- package/dist/src/db/typeorm/generic.repository.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/config/env.validation.ts +1 -0
- package/src/db/typeorm/generic.repository.ts +11 -5
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "xcally-nest-library",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.11",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -24,8 +24,8 @@
|
|
24
24
|
"test:cov": "jest --coverage",
|
25
25
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
26
26
|
"test:e2e": "jest --config ./test/jest-e2e.json",
|
27
|
-
"link
|
28
|
-
"unlink
|
27
|
+
"lib:link": "pnpm link --global",
|
28
|
+
"lib:unlink": "pnpm unlink xcally-nest-libs --global"
|
29
29
|
},
|
30
30
|
"dependencies": {
|
31
31
|
"@nestjs/axios": "^3.0.2",
|
@@ -90,12 +90,18 @@ export class GenericRepository<E extends ObjectLiteral> {
|
|
90
90
|
* @returns A promise that resolves to the retrieved entity.
|
91
91
|
*/
|
92
92
|
async findById(id: number): Promise<E> {
|
93
|
-
|
93
|
+
return await this.repository.findOneBy({
|
94
94
|
id: Equal(id),
|
95
95
|
} as unknown as FindOptionsWhere<E>);
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
96
|
+
}
|
97
|
+
|
98
|
+
/**
|
99
|
+
* Removes an entity from the database based on its ID.
|
100
|
+
*
|
101
|
+
* @param id - The ID of the entity to remove.
|
102
|
+
* @returns A promise that resolves when the entity is successfully removed.
|
103
|
+
*/
|
104
|
+
async remove(id: number): Promise<void> {
|
105
|
+
await this.repository.delete(id);
|
100
106
|
}
|
101
107
|
}
|