farmstar-survey-ui/vueform.config.js
2024-02-05 10:24:52 +03:00

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.org/registration`,
method: 'post'
},
transaction: {
url: `https://pb.farmstar.grassecon.org/transaction`,
method: 'post'
},
farmer: {
url: `https://pb.farmstar.grassecon.org/farmer`,
method: 'post'
},
distributor: {
url: `https://pb.farmstar.grassecon.org/distributor`,
method: 'post'
},
redeem: {
url: `https://pb.farmstar.grassecon.org/redeem`,
method: 'post'
}
}
}