Skip to content

Commit

Permalink
refactor: add types
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Oct 2, 2024
1 parent 03c846e commit 014d5b9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ import type { IPrivateProjectChecker } from '../private-project/privateProjectCh
import type {
IAccessStore,
IAccountStore,
IEvent,
IEventStore,
IOnboardingReadModel,
MinimalUser,
} from '../../types';
import type { FeatureEventFormatter } from '../../addons/feature-event-formatter-md';
import { generateImageUrl } from '../../util';
import type { PersonalDashboardProjectDetailsSchema } from '../../openapi';
import type { IRoleWithProject } from '../../types/stores/access-store';

export class PersonalDashboardService {
private personalDashboardReadModel: IPersonalDashboardReadModel;
Expand Down Expand Up @@ -103,15 +105,15 @@ export class PersonalDashboardService {
userId: number,
projectId: string,
): Promise<PersonalDashboardProjectDetailsSchema> {
const formatEvents = (recentEvents) =>
const formatEvents = (recentEvents: IEvent[]) =>
recentEvents.map((event) => ({
summary: this.featureEventFormatter.format(event).text,
createdBy: event.createdBy,
id: event.id,
createdByImageUrl: generateImageUrl({ email: event.createdBy }),
}));

const filterRoles = (allRoles) =>
const filterRoles = (allRoles: IRoleWithProject[]) =>
allRoles
.filter((role) => ['project', 'custom'].includes(role.type))
.map((role) => ({
Expand Down

0 comments on commit 014d5b9

Please sign in to comment.