mirror of
https://github.com/grassrootseconomics/farmstar-survey-ui.git
synced 2024-10-03 22:47:22 +02:00
43 lines
908 B
JavaScript
43 lines
908 B
JavaScript
|
import en from '@vueform/vueform/locales/en'
|
||
|
import tailwind from '@vueform/vueform/themes/tailwind'
|
||
|
|
||
|
import { Validator } from '@vueform/vueform'
|
||
|
|
||
|
const phoneRule = class extends Validator {
|
||
|
get message() {
|
||
|
return 'The What is your primary phone number? filed requires a valid phone number'
|
||
|
}
|
||
|
|
||
|
check(value) {
|
||
|
return /^(07|01)(\d){8}$/.test(value);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export default {
|
||
|
theme: tailwind,
|
||
|
locales: { en },
|
||
|
locale: 'en',
|
||
|
floatPlaceholders: false,
|
||
|
rules: {
|
||
|
phone: phoneRule,
|
||
|
},
|
||
|
endpoints: {
|
||
|
registration: {
|
||
|
url: `${process.env.BASE_URL}/registration`,
|
||
|
method: 'post'
|
||
|
},
|
||
|
transaction: {
|
||
|
url: `${process.env.BASE_URL}/transaction`,
|
||
|
method: 'post'
|
||
|
},
|
||
|
farmer: {
|
||
|
url: `${process.env.BASE_URL}/farmer`,
|
||
|
method: 'post'
|
||
|
},
|
||
|
distributor: {
|
||
|
url: `${process.env.BASE_URL}/distributor`,
|
||
|
method: 'post'
|
||
|
}
|
||
|
}
|
||
|
}
|