mirror of
https://github.com/bitwarden/browser
synced 2026-02-11 14:04:03 +00:00
[PM-26676] Include organizationId in fetch and generation state emissions
Update _fetchReport$ and _generateNewApplicationsReport$ methods to include organizationId in all state emissions (loading, success, error). This ensures every state update knows which organization it belongs to, enabling the scan operator to detect organization changes. Changes: - _fetchReport$: Add organizationId to all returned states - _generateNewApplicationsReport$: Add organizationId to all returned states Both methods receive organizationId as a parameter and now thread it through to all state emissions.
This commit is contained in:
@@ -343,10 +343,11 @@ export class RiskInsightsOrchestratorService {
|
||||
loading: false,
|
||||
error: null,
|
||||
data: result ?? null,
|
||||
organizationId,
|
||||
};
|
||||
}),
|
||||
catchError(() => of({ loading: false, error: "Failed to fetch report", data: null })),
|
||||
startWith({ loading: true, error: null, data: null }),
|
||||
catchError(() => of({ loading: false, error: "Failed to fetch report", data: null, organizationId })),
|
||||
startWith({ loading: true, error: null, data: null, organizationId }),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -407,12 +408,13 @@ export class RiskInsightsOrchestratorService {
|
||||
creationDate: new Date(),
|
||||
contentEncryptionKey,
|
||||
},
|
||||
organizationId,
|
||||
};
|
||||
}),
|
||||
catchError((): Observable<ReportState> => {
|
||||
return of({ loading: false, error: "Failed to generate or save report", data: null });
|
||||
return of({ loading: false, error: "Failed to generate or save report", data: null, organizationId });
|
||||
}),
|
||||
startWith<ReportState>({ loading: true, error: null, data: null }),
|
||||
startWith<ReportState>({ loading: true, error: null, data: null, organizationId }),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user