refactor(server): rename tx to db (#9867)

This commit is contained in:
fengmk2
2025-01-23 07:52:45 +00:00
parent 6ac6a8d6d6
commit 2088b760bf
7 changed files with 32 additions and 34 deletions
@@ -68,7 +68,7 @@ export class UserFeatureModel extends BaseModel {
async add(userId: string, featureName: UserFeatureName, reason: string) {
const feature = await this.models.feature.get_unchecked(featureName);
const existing = await this.tx.userFeature.findFirst({
const existing = await this.db.userFeature.findFirst({
where: {
userId,
featureId: feature.id,
@@ -80,7 +80,7 @@ export class UserFeatureModel extends BaseModel {
return existing;
}
const userFeature = await this.tx.userFeature.create({
const userFeature = await this.db.userFeature.create({
data: {
userId,
featureId: feature.id,
@@ -97,7 +97,7 @@ export class UserFeatureModel extends BaseModel {
async remove(userId: string, featureName: UserFeatureName) {
const feature = await this.models.feature.get_unchecked(featureName);
await this.tx.userFeature.deleteMany({
await this.db.userFeature.deleteMany({
where: {
userId,
featureId: feature.id,