Skip to content

Commit 43c5ef9

Browse files
committed
fix(import-rule): refactor saveRule method for improved clarity and structure
1 parent fcac4d6 commit 43c5ef9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

frontend/src/app/rule-management/app-rule/components/import-rules/import-rule.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export class ImportRuleComponent implements OnInit, OnDestroy {
5151
saveRule() {
5252
this.loading = true;
5353
from(this.rules).pipe(
54-
concatMap(rule =>
55-
this.ruleService.saveRule('ADD', rule).pipe(
54+
concatMap(ruleData => {
55+
const rule = ruleData.rule as Rule;
56+
return this.ruleService.saveRule('ADD', rule).pipe(
5657
tap(() => rule.isLoading = !rule.isLoading),
5758
map((response: HttpResponse<any>) => {
5859
if (response.status === 204) {
@@ -68,8 +69,8 @@ export class ImportRuleComponent implements OnInit, OnDestroy {
6869
rule.status = 'error';
6970
return of(rule);
7071
})
71-
)
72-
),
72+
);
73+
}),
7374
toArray()
7475
).subscribe({
7576
next: response => {

0 commit comments

Comments
 (0)