fd3783cc8d
+ added test coverage
15 lines
476 B
TypeScript
15 lines
476 B
TypeScript
import AppProjections from "./AppProjections";
|
|
import { UpdateDefinition } from "./projections/ApplicationUpdates";
|
|
|
|
export default class AppQueries {
|
|
constructor(private readonly projections: AppProjections) {}
|
|
|
|
pendingApplicationUpdates(appName?: string): UpdateDefinition[] {
|
|
const updates = this.projections.ApplicationUpdates.getPendingUpdates();
|
|
if (!appName) {
|
|
return updates;
|
|
}
|
|
return updates.filter((update) => update.id === appName);
|
|
}
|
|
}
|