Skip to content
This repository was archived by the owner on Jan 24, 2023. It is now read-only.

Commit 8f6a228

Browse files
committed
fix: fixed issue
1 parent b35e01c commit 8f6a228

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

packages/@simpli/cli/lib/scaffold/Swagger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ module.exports = class Swagger {
199199
name: 'authApiName',
200200
type: 'list',
201201
choices: apis.map((api) => api.name),
202-
default: apis.findIndex((api) => api.name === 'auth') || 0,
202+
default: apis.findIndex((api) => api.name === 'authenticate') || 0,
203203
message: 'Which API is the authentication?'
204204
}
205205
])

packages/@simpli/cli/lib/scaffold/setup/Api.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ module.exports = class Api {
233233
buildSignIn (auth = new Auth()) {
234234
let result = ''
235235

236-
result += ` async ${this.name}(request: ${this.body.model}, spinner = '${this.name}') {\n`
236+
result += ` async ${this.name}(request: ${this.body.model}, spinner = '${this.name}', delay = 1000) {\n`
237237
result += ` const model = new ${this.body.model}()\n\n`
238238

239239
result += ` model.${auth.accountAttrName} = request.${auth.accountAttrName}\n`
@@ -244,7 +244,7 @@ module.exports = class Api {
244244
result += ` return await this.${this.methodUppercase}(\`${this.stringfyEndpoint}\`, model)\n`
245245
result += ` }\n\n`
246246

247-
result += ` return await $.await.run(fetch, spinner)\n`
247+
result += ` return await $.await.run(fetch, spinner, delay)\n`
248248
result += ` }\n`
249249

250250
return result
@@ -256,13 +256,13 @@ module.exports = class Api {
256256
buildResetPassword () {
257257
let result = ''
258258

259-
result += ` async ${this.name}(request: ${this.body.model}, spinner = '${this.name}') {\n`
259+
result += ` async ${this.name}(request: ${this.body.model}, spinner = '${this.name}', delay = 1000) {\n`
260260
result += ` const fetch = async () => {\n`
261261
result += ` await request.validate()\n`
262262
result += ` return await this.${this.methodUppercase}(\`${this.stringfyEndpoint}\`, request)\n`
263263
result += ` }\n\n`
264264

265-
result += ` return await $.await.run(fetch, spinner)\n`
265+
result += ` return await $.await.run(fetch, spinner, delay)\n`
266266
result += ` }\n`
267267

268268
return result
@@ -274,7 +274,7 @@ module.exports = class Api {
274274
buildRecoverPassword () {
275275
let result = ''
276276

277-
result += ` async ${this.name}(request: ${this.body.model}, spinner = '${this.name}') {\n`
277+
result += ` async ${this.name}(request: ${this.body.model}, spinner = '${this.name}', delay = 1000) {\n`
278278
result += ` const model = new ${this.body.model}()\n\n`
279279

280280
result += ` model.newPassword = encrypt(request.newPassword || '')\n`
@@ -285,7 +285,7 @@ module.exports = class Api {
285285
result += ` return await this.${this.methodUppercase}(\`${this.stringfyEndpoint}\`, request)\n`
286286
result += ` }\n\n`
287287

288-
result += ` return await $.await.run(fetch, spinner)\n`
288+
result += ` return await $.await.run(fetch, spinner, delay)\n`
289289
result += ` }\n`
290290

291291
return result
@@ -297,7 +297,7 @@ module.exports = class Api {
297297
buildChangePassword () {
298298
let result = ''
299299

300-
result += ` async ${this.name}(request: ${this.body.model}, spinner = '${this.name}') {\n`
300+
result += ` async ${this.name}(request: ${this.body.model}, spinner = '${this.name}', delay = 1000) {\n`
301301
result += ` const model = new ${this.body.model}()\n\n`
302302

303303
result += ` model.currentPassword = encrypt(request.currentPassword || '')\n`
@@ -308,7 +308,7 @@ module.exports = class Api {
308308
result += ` return await this.${this.methodUppercase}(\`${this.stringfyEndpoint}\`, request)\n`
309309
result += ` }\n\n`
310310

311-
result += ` return await $.await.run(fetch, spinner)\n`
311+
result += ` return await $.await.run(fetch, spinner, delay)\n`
312312
result += ` }\n`
313313

314314
return result

0 commit comments

Comments
 (0)