wip
This commit is contained in:
@@ -35,8 +35,6 @@ export class GetCurrentUserSocialUseCase
|
||||
avatarUrl: '',
|
||||
isOnline: false,
|
||||
lastSeen: new Date(),
|
||||
primaryLeagueId: undefined,
|
||||
primaryTeamId: undefined,
|
||||
}));
|
||||
|
||||
const currentUser: CurrentUserSocialDTO = {
|
||||
@@ -44,8 +42,6 @@ export class GetCurrentUserSocialUseCase
|
||||
displayName: '',
|
||||
avatarUrl: '',
|
||||
countryCode: '',
|
||||
primaryTeamId: undefined,
|
||||
primaryLeagueId: undefined,
|
||||
};
|
||||
|
||||
const viewModel: CurrentUserSocialViewModel = {
|
||||
|
||||
@@ -33,22 +33,27 @@ export class GetUserFeedUseCase
|
||||
}
|
||||
|
||||
function mapFeedItemToDTO(item: FeedItem): FeedItemDTO {
|
||||
return {
|
||||
const mappedType = (item.type as string).replace(/-/g, '_') as FeedItemDTO['type'];
|
||||
|
||||
const dto: FeedItemDTO = {
|
||||
id: item.id,
|
||||
timestamp:
|
||||
item.timestamp instanceof Date
|
||||
? item.timestamp.toISOString()
|
||||
: new Date(item.timestamp).toISOString(),
|
||||
type: item.type,
|
||||
actorFriendId: item.actorFriendId,
|
||||
actorDriverId: item.actorDriverId,
|
||||
leagueId: item.leagueId,
|
||||
raceId: item.raceId,
|
||||
teamId: item.teamId,
|
||||
position: item.position,
|
||||
type: mappedType,
|
||||
headline: item.headline,
|
||||
body: item.body,
|
||||
ctaLabel: item.ctaLabel,
|
||||
ctaHref: item.ctaHref,
|
||||
};
|
||||
|
||||
if (item.actorFriendId !== undefined) dto.actorFriendId = item.actorFriendId;
|
||||
if (item.actorDriverId !== undefined) dto.actorDriverId = item.actorDriverId;
|
||||
if (item.leagueId !== undefined) dto.leagueId = item.leagueId;
|
||||
if (item.raceId !== undefined) dto.raceId = item.raceId;
|
||||
if (item.teamId !== undefined) dto.teamId = item.teamId;
|
||||
if (item.position !== undefined) dto.position = item.position;
|
||||
if (item.body !== undefined) dto.body = item.body;
|
||||
if (item.ctaLabel !== undefined) dto.ctaLabel = item.ctaLabel;
|
||||
if (item.ctaHref !== undefined) dto.ctaHref = item.ctaHref;
|
||||
|
||||
return dto;
|
||||
}
|
||||
Reference in New Issue
Block a user