refactor: simplify and cleanup front-end

This commit is contained in:
José Oliveira 2021-02-15 13:46:09 +00:00 committed by Josh Harvey
parent a8fbb57bf6
commit 351d2a078b
14 changed files with 93 additions and 213 deletions

View file

@ -8,7 +8,6 @@ import secretTest from './helper'
export default {
code: 'itbit',
name: 'itBit',
hasSecret: true,
title: 'itBit (Exchange)',
elements: [
{
@ -36,22 +35,8 @@ export default {
component: SecretInputFormik
}
],
validationSchema: Yup.object().shape({
userId: Yup.string()
.max(100, 'Too long')
.required(),
walletId: Yup.string()
.max(100, 'Too long')
.required(),
clientKey: Yup.string()
.max(100, 'Too long')
.required(),
clientSecret: Yup.string()
.max(100, 'Too long')
.required()
}),
getValidationSchema: account => {
const schema = {
return Yup.object().shape({
userId: Yup.string()
.max(100, 'Too long')
.required(),
@ -64,7 +49,6 @@ export default {
clientSecret: Yup.string()
.max(100, 'Too long')
.test(secretTest(account?.clientSecret))
}
return Yup.object().shape(schema)
})
}
}