Skip to content

Commit b4dd8c3

Browse files
author
Antti Huovila
committed
Cleaned up a function
Signed-off-by: Antti Huovila <anthu456@student.liu.se>
1 parent 0af308b commit b4dd8c3

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/views/portfolio/projects/ProjectComponents.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -429,16 +429,14 @@ export default {
429429
try {
430430
let allDependencies = [];
431431
let page = 1;
432-
let pageSize = 100; // Adjust based on API limits
433-
//Step 1: Fetch all dependencies and handling pagination
432+
let pageSize = 100;
434433
while (true) {
435434
let response = await this.axios.get(`${getDependenciesUrl}?page=${page}&size=${pageSize}`);
436435
let dependencies = response.data;
437436
if (!dependencies || dependencies.length === 0) break;
438437
allDependencies = allDependencies.concat(dependencies);
439438
page++;
440439
}
441-
//Step 2: Delete dependencies in batches
442440
let batchSize = 50;
443441
let lengthAllDependencies = allDependencies.length;
444442
if (lengthAllDependencies !== 0) {
@@ -452,12 +450,9 @@ export default {
452450
await Promise.all(deletePromises);
453451
this.$refs.table.refresh({ silent: true });
454452
}
455-
//Step 3: Delete the BOM after all its components are removed
456453
await this.axios.delete(deleteBomUrl);
457454
this.$toastr.s(this.$t("message.bom_deleted"));
458-
//Step 4: Refresh the table
459455
this.$refs.table.removeAll();
460-
//Step 5: Refresh the metrics
461456
await this.axios.get(`/api/v1/metrics/project/${this.uuid}/refresh`);
462457
}
463458
else {

0 commit comments

Comments
 (0)