Skip to content

Commit

Permalink
Tag hotfix (#357)
Browse files Browse the repository at this point in the history
* add date to config json to avoid caching

* fixed syntax error on qs

* hotfix for tags

* added todo comment, removed console log
  • Loading branch information
sdstolworthy authored Oct 30, 2020
1 parent 064f77f commit 784ebf6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function EngagementEditableCategories({
onSave: (engagement: Engagement) => void;
engagement: Engagement;
}) {
const { saveEngagement } = useEngagements();
const [chips, setChips] = useState<string[]>([]);
const [editMode, setEditMode] = useState(false);
const [hasFetched, setHasFetched] = useState(false);
Expand Down Expand Up @@ -76,10 +77,10 @@ export function EngagementEditableCategories({

const SaveAndCloseEditMode = (selectedChips: string[]) => {
setEditMode(!editMode);
engagement.engagement_categories = selectedChips
.map(chip => [{ name: chip }])
.flat();
propsOnSave(engagement);
saveEngagement({
...engagement,
engagement_categories: selectedChips.map(chip => ({ name: chip })),
});
};

const cancelEdit = () => {
Expand All @@ -103,4 +104,3 @@ export function EngagementEditableCategories({
</>
);
}

3 changes: 3 additions & 0 deletions src/serializers/engagement/engagement_json_serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export class EngagementJsonSerializer
deserialize(data: object): Engagement {
return {
...data,
use_cases: data['use_cases'],
mongo_id: data['mongo_id'],
public_reference: data['public_reference'],
additional_details: data['additional_details'],
archive_date: data['archive_date']
? EngagementJsonSerializer.parseDate(data['archive_date'])
Expand Down

0 comments on commit 784ebf6

Please sign in to comment.