Skip to content

Commit

Permalink
added date serializer to archive_date (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdstolworthy authored Jun 29, 2020
1 parent 724a926 commit 475c6e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import { useEngagements } from '../../context/engagement_context/engagement_hook
import { DescriptionFormField } from '../engagement_form_fields/description';
import { LocationFormField } from '../engagement_form_fields/location';
import { EngagementStartEndDateFormField } from '../engagement_form_fields/engagement_start_end_date';
import { EngagementFormConfig } from '../../schemas/engagement_config';

export interface EngagementSummaryEditModalProps {
onChange: (fieldName: string, value: any) => void;
formOptions: object;
formOptions: EngagementFormConfig;
engagement: Engagement;
isOpen: boolean;
onSave: (engagement: Engagement) => void;
Expand Down Expand Up @@ -50,6 +51,7 @@ export function EngagementSummaryEditModal(
/>
<EngagementStartEndDateFormField
onChange={props.onChange}
formOptions={props.formOptions}
engagement={props.engagement}
/>
</Form>
Expand Down
4 changes: 3 additions & 1 deletion src/serializers/engagement/engagement_json_serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export class EngagementJsonSerializer
}
deserialize(data: object): Engagement {
return {
archive_date: data['archive_date'],
archive_date: data['archive_date']
? EngagementJsonSerializer.parseDate(data['archive_date'])
: undefined,
commits: (data['commits'] as any[])
?.filter(d => !(d['author_email'] === '[email protected]'))
?.map(d => EngagementJsonSerializer.gitCommitSerializer.deserialize(d)),
Expand Down

0 comments on commit 475c6e9

Please sign in to comment.