fix(linkedin): fix skill modal crashing when importing from linkedin

fix #718
This commit is contained in:
Amruth Pillai 2022-03-17 13:58:49 +01:00
parent b3ff7805cd
commit a02b85b4bb
No known key found for this signature in database
GPG Key ID: E3C57DF9B80855AD
3 changed files with 4 additions and 3 deletions

View File

@ -8,14 +8,14 @@ import styles from './ArrayInput.module.scss';
type Props = {
label: string;
value: string[];
value?: string[];
className?: string;
onChange: (event: any) => void;
errors?: FieldError | FieldError[];
};
const ArrayInput: React.FC<Props> = ({ value, label, onChange, errors, className }) => {
const [items, setItems] = useState<string[]>(value);
const [items, setItems] = useState<string[]>(value || []);
const onAdd = () => setItems([...items, '']);

View File

@ -159,7 +159,7 @@ const SkillModal: React.FC = () => {
render={({ field, fieldState }) => (
<ArrayInput
label={t('builder.common.form.keywords.label')}
value={field.value as string[]}
value={field.value}
onChange={field.onChange}
errors={fieldState.error}
className="col-span-2"

View File

@ -242,6 +242,7 @@ export class IntegrationsService {
name: get(skill, 'Name'),
level: 'Beginner',
levelNum: 5,
keywords: [],
} as Skill,
],
},