Skip to content

Commit 60805a6

Browse files
chore: wip
1 parent 9139ee6 commit 60805a6

File tree

15 files changed

+45
-33
lines changed

15 files changed

+45
-33
lines changed

storage/framework/core/orm/src/utils.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,16 +1809,20 @@ export async function generateModelString(
18091809
18101810
static async get(): Promise<${modelName}Model[]> {
18111811
const instance = new ${modelName}Model(null)
1812-
1813-
let models
18141812
1813+
let models
1814+
18151815
if (instance.hasSelect) {
1816+
${instanceSoftDeleteStatements}
1817+
18161818
models = await instance.selectFromQuery.execute()
18171819
} else {
1820+
${instanceSoftDeleteStatements}
1821+
18181822
models = await instance.selectFromQuery.selectAll().execute()
18191823
}
1820-
1821-
const userModels = await Promise.all(models.map(async (model: ${modelName}Model) => {
1824+
1825+
const data = await Promise.all(models.map(async (model: ${modelName}Model) => {
18221826
${relationDeclare}
18231827
18241828
${relationStringMany}
@@ -1827,7 +1831,7 @@ export async function generateModelString(
18271831
return model
18281832
}))
18291833
1830-
return userModels
1834+
return data
18311835
}
18321836
18331837

storage/framework/orm/src/models/AccessToken.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ export class AccessTokenModel {
163163
models = await instance.selectFromQuery.selectAll().execute()
164164
}
165165

166-
const userModels = await Promise.all(models.map(async (model: AccessTokenModel) => {
166+
const data = await Promise.all(models.map(async (model: AccessTokenModel) => {
167167
return model
168168
}))
169169

170-
return userModels
170+
return data
171171
}
172172

173173
// Method to get a AccessToken by criteria

storage/framework/orm/src/models/Deployment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,15 @@ export class DeploymentModel {
189189
models = await instance.selectFromQuery.selectAll().execute()
190190
}
191191

192-
const userModels = await Promise.all(models.map(async (model: DeploymentModel) => {
192+
const data = await Promise.all(models.map(async (model: DeploymentModel) => {
193193
const instance = new DeploymentModel(model as DeploymentType)
194194

195195
model.user = await instance.userBelong()
196196

197197
return model
198198
}))
199199

200-
return userModels
200+
return data
201201
}
202202

203203
// Method to get a Deployment by criteria

storage/framework/orm/src/models/Error.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ export class ErrorModel {
167167
models = await instance.selectFromQuery.selectAll().execute()
168168
}
169169

170-
const userModels = await Promise.all(models.map(async (model: ErrorModel) => {
170+
const data = await Promise.all(models.map(async (model: ErrorModel) => {
171171
return model
172172
}))
173173

174-
return userModels
174+
return data
175175
}
176176

177177
// Method to get a Error by criteria

storage/framework/orm/src/models/PaymentMethod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class PaymentMethodModel {
202202
models = await instance.selectFromQuery.selectAll().execute()
203203
}
204204

205-
const userModels = await Promise.all(models.map(async (model: PaymentMethodModel) => {
205+
const data = await Promise.all(models.map(async (model: PaymentMethodModel) => {
206206
const instance = new PaymentMethodModel(model as PaymentMethodType)
207207

208208
model.transactions = await instance.transactionsHasMany()
@@ -212,7 +212,7 @@ export class PaymentMethodModel {
212212
return model
213213
}))
214214

215-
return userModels
215+
return data
216216
}
217217

218218
// Method to get a PaymentMethod by criteria

storage/framework/orm/src/models/Post.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ export class PostModel {
170170
models = await instance.selectFromQuery.selectAll().execute()
171171
}
172172

173-
const userModels = await Promise.all(models.map(async (model: PostModel) => {
173+
const data = await Promise.all(models.map(async (model: PostModel) => {
174174
const instance = new PostModel(model as PostType)
175175

176176
model.user = await instance.userBelong()
177177

178178
return model
179179
}))
180180

181-
return userModels
181+
return data
182182
}
183183

184184
// Method to get a Post by criteria

storage/framework/orm/src/models/Product.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ export class ProductModel {
174174
models = await instance.selectFromQuery.selectAll().execute()
175175
}
176176

177-
const userModels = await Promise.all(models.map(async (model: ProductModel) => {
177+
const data = await Promise.all(models.map(async (model: ProductModel) => {
178178
return model
179179
}))
180180

181-
return userModels
181+
return data
182182
}
183183

184184
// Method to get a Product by criteria

storage/framework/orm/src/models/Project.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ export class ProjectModel {
161161
models = await instance.selectFromQuery.selectAll().execute()
162162
}
163163

164-
const userModels = await Promise.all(models.map(async (model: ProjectModel) => {
164+
const data = await Promise.all(models.map(async (model: ProjectModel) => {
165165
return model
166166
}))
167167

168-
return userModels
168+
return data
169169
}
170170

171171
// Method to get a Project by criteria

storage/framework/orm/src/models/Release.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ export class ReleaseModel {
152152
models = await instance.selectFromQuery.selectAll().execute()
153153
}
154154

155-
const userModels = await Promise.all(models.map(async (model: ReleaseModel) => {
155+
const data = await Promise.all(models.map(async (model: ReleaseModel) => {
156156
return model
157157
}))
158158

159-
return userModels
159+
return data
160160
}
161161

162162
// Method to get a Release by criteria

storage/framework/orm/src/models/Subscriber.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ export class SubscriberModel {
152152
models = await instance.selectFromQuery.selectAll().execute()
153153
}
154154

155-
const userModels = await Promise.all(models.map(async (model: SubscriberModel) => {
155+
const data = await Promise.all(models.map(async (model: SubscriberModel) => {
156156
return model
157157
}))
158158

159-
return userModels
159+
return data
160160
}
161161

162162
// Method to get a Subscriber by criteria

0 commit comments

Comments
 (0)