mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
incremental issue count for each project created
This commit is contained in:
@@ -7,18 +7,20 @@ export const createDemoData = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const projectNames = ["PROJ", "TEST", "SAMPLE"];
|
const projectNames = ["PROJ", "TEST", "SAMPLE"];
|
||||||
|
let issuesToCreate = 3;
|
||||||
for (const name of projectNames) {
|
for (const name of projectNames) {
|
||||||
const project = await createProject(name.slice(0, 4), name, user.id);
|
const project = await createProject(name.slice(0, 4), name, user.id);
|
||||||
if (!project) {
|
if (!project) {
|
||||||
throw new Error(`failed to create demo project: ${name}`);
|
throw new Error(`failed to create demo project: ${name}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 1; i <= 5; i++) {
|
for (let i = 1; i <= issuesToCreate; i++) {
|
||||||
await createIssue(
|
await createIssue(
|
||||||
project.id,
|
project.id,
|
||||||
`Issue ${i} in ${name}`,
|
`Issue ${i} in ${name}`,
|
||||||
`This is a description for issue ${i} in ${name}.`,
|
`This is a description for issue ${i} in ${name}.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
issuesToCreate++;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user