mirror of
https://github.com/grassrootseconomics/farmstar-survey-ui.git
synced 2024-11-16 08:36:45 +01:00
47 lines
1016 B
JavaScript
47 lines
1016 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 phone field 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: `https://pb.farmstar.grassecon.net/registration`,
|
|
method: 'post'
|
|
},
|
|
transaction: {
|
|
url: `https://pb.farmstar.grassecon.net/transaction`,
|
|
method: 'post'
|
|
},
|
|
farmer: {
|
|
url: `https://pb.farmstar.grassecon.net/farmer`,
|
|
method: 'post'
|
|
},
|
|
distributor: {
|
|
url: `https://pb.farmstar.grassecon.net/distributor`,
|
|
method: 'post'
|
|
},
|
|
redeem: {
|
|
url: `https://pb.farmstar.grassecon.net/redeem`,
|
|
method: 'post'
|
|
}
|
|
}
|
|
}
|