fix(linkedin): fix skill modal crashing when importing from linkedin
fix #718
This commit is contained in:
parent
b3ff7805cd
commit
a02b85b4bb
|
@ -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, '']);
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -242,6 +242,7 @@ export class IntegrationsService {
|
|||
name: get(skill, 'Name'),
|
||||
level: 'Beginner',
|
||||
levelNum: 5,
|
||||
keywords: [],
|
||||
} as Skill,
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue