Skip to content

Commit

Permalink
fix(core): revert the changes of 2158 (#2181)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeshamavani authored Oct 22, 2024
1 parent d9dcef5 commit 1307aa0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export abstract class DefaultTransactionalUserModifyRepository<
throw new HttpErrors.Forbidden(AuthErrorKeys.InvalidCredentials);
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
entity.createdOn = new Date();
entity.modifiedOn = new Date();
entity.createdBy = uid;
entity.modifiedBy = uid;
return super.create(entity, options);
Expand All @@ -58,8 +56,6 @@ export abstract class DefaultTransactionalUserModifyRepository<
entities.forEach(entity => {
entity.createdBy = uid ?? '';
entity.modifiedBy = uid ?? '';
entity.createdOn = new Date();
entity.modifiedOn = new Date();
});
return super.createAll(entities, options);
}
Expand All @@ -71,8 +67,6 @@ export abstract class DefaultTransactionalUserModifyRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
entity.modifiedBy = uid;
delete entity.createdOn;
entity.modifiedOn = new Date();
return super.save(entity, options);
}

Expand All @@ -83,8 +77,6 @@ export abstract class DefaultTransactionalUserModifyRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
entity.modifiedBy = uid;
delete entity.createdOn;
delete entity.modifiedOn;
return super.update(entity, options);
}

Expand All @@ -100,8 +92,6 @@ export abstract class DefaultTransactionalUserModifyRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
data.modifiedBy = uid;
delete data.createdOn;
delete data.modifiedOn;
return super.updateAll(data, where, options);
}

Expand All @@ -117,8 +107,6 @@ export abstract class DefaultTransactionalUserModifyRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
data.modifiedBy = uid;
delete data.createdOn;
delete data.modifiedOn;
return super.updateById(id, data, options);
}

Expand All @@ -133,8 +121,6 @@ export abstract class DefaultTransactionalUserModifyRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
data.modifiedBy = uid;
delete data.createdOn;
delete data.modifiedOn;
return super.replaceById(id, data, options);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ export class DefaultUserModifyCrudRepository<
const uid = currentUser?.userTenantId ?? currentUser?.id;
entity.createdBy = uid;
entity.modifiedBy = uid;
entity.createdOn = new Date();
entity.modifiedOn = new Date();
return super.create(entity, options);
}

Expand All @@ -59,8 +57,6 @@ export class DefaultUserModifyCrudRepository<
entities.forEach(entity => {
entity.createdBy = uid ?? '';
entity.modifiedBy = uid ?? '';
entity.createdOn = new Date();
entity.modifiedOn = new Date();
});
return super.createAll(entities, options);
}
Expand All @@ -72,8 +68,6 @@ export class DefaultUserModifyCrudRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
entity.modifiedBy = uid;
delete entity.createdOn;
entity.modifiedOn = new Date();
return super.save(entity, options);
}

Expand All @@ -84,8 +78,6 @@ export class DefaultUserModifyCrudRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
entity.modifiedBy = uid;
delete entity.createdOn;
delete entity.modifiedOn;
return super.update(entity, options);
}

Expand All @@ -101,8 +93,6 @@ export class DefaultUserModifyCrudRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
data.modifiedBy = uid;
delete data.createdOn;
delete data.modifiedOn;
return super.updateAll(data, where, options);
}

Expand All @@ -118,8 +108,6 @@ export class DefaultUserModifyCrudRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
data.modifiedBy = uid;
delete data.createdOn;
delete data.modifiedOn;
return super.updateById(id, data, options);
}
async replaceById(
Expand All @@ -133,8 +121,6 @@ export class DefaultUserModifyCrudRepository<
}
const uid = currentUser?.userTenantId ?? currentUser?.id;
data.modifiedBy = uid;
delete data.createdOn;
delete data.modifiedOn;
return super.replaceById(id, data, options);
}
}

0 comments on commit 1307aa0

Please sign in to comment.