fix: base service bug

pull/21/merge
xiaojunnuo 2023-05-01 21:51:41 +08:00
parent 458756e895
commit 0a946f55ca
2 changed files with 2 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "0.0.0",
"version": "1.0.0",
"npmClient": "yarn"
}

View File

@ -23,9 +23,7 @@ export abstract class BaseService<T> {
if (!id) {
throw new ValidateException('id不能为空');
}
const info = await this.getRepository().findOne({
where:{ id }
});
const info = await this.getRepository().findOneBy({ id } as any);
if (info && infoIgnoreProperty) {
for (const property of infoIgnoreProperty) {
delete info[property];