Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const onSubmit = useCallback(async () => {
setDisableSubmit(true);
try {
const project = await create({ name, language, isPublic, description }, groupId, typeId);
const id = idFromRecordIdentity(dataStore, project);
history.push(`/projects/${id}`);
} catch (e) {
toast.error(e);
setDisableSubmit(false);
}
}, [create, name, language, isPublic, description, groupId, typeId, dataStore, history]);