Skip to content

Commit

Permalink
Merge branch 'main' into view-archetypes-by-app
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 authored Sep 20, 2023
2 parents b81d41b + 734b8ac commit c1d1e49
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import type {
Archetype,
New,
Ref,
Stakeholder,
StakeholderGroup,
Tag,
Expand Down Expand Up @@ -174,14 +175,20 @@ export const ArchetypeForm: React.FC<ArchetypeFormProps> = ({
? undefined
: (values.stakeholders
.map((name) => stakeholders.find((s) => s.name === name))
.filter(Boolean) as Stakeholder[]),
.map<Ref | undefined>((sh) =>
!sh ? undefined : { id: sh.id, name: sh.name }
)
.filter(Boolean) as Ref[]),

stakeholderGroups:
values.stakeholderGroups === undefined
? undefined
: (values.stakeholderGroups
.map((name) => stakeholderGroups.find((s) => s.name === name))
.filter(Boolean) as StakeholderGroup[]),
.map<Ref | undefined>((sg) =>
!sg ? undefined : { id: sg.id, name: sg.name }
)
.filter(Boolean) as Ref[]),
};

if (archetype && !isDuplicating) {
Expand All @@ -190,7 +197,7 @@ export const ArchetypeForm: React.FC<ArchetypeFormProps> = ({
createArchetype(payload);
}
};
console.log("values", getValues(), getFieldState("criteriaTags"), formState);

return (
<Form onSubmit={handleSubmit(onValidSubmit)} id="archetype-form">
<HookFormPFTextInput
Expand Down

0 comments on commit c1d1e49

Please sign in to comment.