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

Commit b136376

Browse files
committed
fix(cms): Adjusting tabs in the linting
1 parent 5341eb8 commit b136376

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

cms/src/config/seed/users.ts

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Define a type for the strapi parameter
22
interface Strapi {
33
entityService: {
4-
count: (query: string) => Promise<number>;
5-
create: (query: string, data: { data: User }) => Promise<void>;
4+
count: (query: string) => Promise<number>;
5+
create: (query: string, data: { data: User }) => Promise<void>;
66
};
7-
}
8-
9-
// Define a type for the user object
10-
interface User {
7+
}
8+
9+
// Define a type for the user object
10+
interface User {
1111
username: string;
1212
email: string;
1313
provider: string;
@@ -19,35 +19,35 @@ interface Strapi {
1919
role: number;
2020
old_pw_hash: null;
2121
migrated_pw: boolean;
22-
}
23-
24-
export async function seedUsers(strapi: Strapi) {
22+
}
23+
24+
export async function seedUsers(strapi: Strapi) {
2525
const amountOfUsers = 10;
2626
try {
27-
const count = await strapi.entityService.count("plugin::users-permissions.user");
28-
if (count === 0) {
29-
for (let i = 0; i < amountOfUsers; i++) {
30-
const user: User = {
31-
username: `dummyUser${i}`,
32-
email: `dummyUser${i}@example.com`,
33-
provider: "local",
34-
password: "dummyPassword",
35-
resetPasswordToken: null,
36-
confirmationToken: null,
37-
confirmed: true,
38-
blocked: false,
39-
role: 1,
40-
old_pw_hash: null,
41-
migrated_pw: false,
42-
};
43-
await strapi.entityService.create("plugin::users-permissions.user", { data: user });
27+
const count = await strapi.entityService.count("plugin::users-permissions.user");
28+
if (count === 0) {
29+
for (let i = 0; i < amountOfUsers; i++) {
30+
const user: User = {
31+
username: `dummyUser${i}`,
32+
email: `dummyUser${i}@example.com`,
33+
provider: "local",
34+
password: "dummyPassword",
35+
resetPasswordToken: null,
36+
confirmationToken: null,
37+
confirmed: true,
38+
blocked: false,
39+
role: 1,
40+
old_pw_hash: null,
41+
migrated_pw: false,
42+
};
43+
await strapi.entityService.create("plugin::users-permissions.user", { data: user });
44+
}
45+
console.log("SUCCESS: Created user on bootstrap");
46+
} else {
47+
console.log("INFO: User have already been created on bootstrap");
4448
}
45-
console.log("SUCCESS: Created user on bootstrap");
46-
} else {
47-
console.log("INFO: User have already been created on bootstrap");
48-
}
4949
} catch (err) {
50-
console.log("ERROR: Could not create users on bootstrap");
51-
console.log(err);
50+
console.log("ERROR: Could not create users on bootstrap");
51+
console.log(err);
5252
}
53-
}
53+
}

0 commit comments

Comments
 (0)