Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit faed47e

Browse files
committed
fix(cms): Fix linting issues
1 parent 46bc984 commit faed47e

File tree

2 files changed

+27
-39
lines changed

2 files changed

+27
-39
lines changed

cms/src/index.ts

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,20 @@ export default {
1616
* This gives you an opportunity to set up your data model,
1717
* run jobs, or perform some special logic.
1818
*/
19-
async bootstrap ({ strapi }){
20-
const user = {
21-
"username": "dummyUser",
22-
"email": "[email protected]",
23-
"provider": "local",
24-
"password": "dummyPassword",
25-
"resetPasswordToken": null,
26-
"confirmationToken": null,
27-
"confirmed": true,
28-
"blocked": false,
29-
"role": 1,
30-
"old_pw_hash": null,
31-
"migrated_pw": false
32-
}
33-
try{
19+
async bootstrap ({ strapi }) {
20+
try{
3421
const count = await strapi.entityService.count("plugin::users-permissions.user")
35-
if(count ===0){
36-
createUserSeed(strapi, 10)
37-
console.log("SUCCESS: Created user on bootstrap")
22+
if(count === 0){
23+
createUserSeed(strapi, 10);
24+
console.log("SUCCESS: Created user on bootstrap");
3825
}
3926
else{
40-
console.log("INFO: User have already been created on bootstrap")
27+
console.log("INFO: User have already been created on bootstrap");
4128
}
42-
}
43-
catch(err){
29+
}
30+
catch(err){
4431
console.log("ERROR: Could not create user on bootstrap")
45-
console.log(err.details)
46-
}
47-
}
32+
console.log(err.details);
33+
}
34+
}
4835
};

cms/src/seed.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
export async function createUserSeed(strapi, amountOfUsers: number){
1+
export async function createUserSeed(strapi, amountOfUsers : number){
22
console.log("Function called")
33

44
for(let i = 0; i < amountOfUsers; i++){
55
const user = {
6-
"username": `dummyUser${i}`,
7-
"email": `dummyUser${i}@example.com`,
8-
"provider": "local",
9-
"password": "dummyPassword",
10-
"resetPasswordToken": null,
11-
"confirmationToken": null,
12-
"confirmed": true,
13-
"blocked": false,
14-
"role": 1,
15-
"old_pw_hash": null,
16-
"migrated_pw": false
17-
}
18-
await strapi.entityService.create("plugin::users-permissions.user", {data: user})
19-
}
6+
username: `dummyUser${i}`,
7+
email: `dummyUser${i}@example.com`,
8+
provider: "local",
9+
password: "dummyPassword",
10+
resetPasswordToken: null,
11+
confirmationToken: null,
12+
confirmed: true,
13+
blocked: false,
14+
role: 1,
15+
old_pw_hash: null,
16+
migrated_pw: false
17+
};
18+
await strapi.entityService.create("plugin::users-permissions.user", {data: user});
19+
}
20+
2021
}

0 commit comments

Comments
 (0)