2024-01-19 10:51:33 +01:00
|
|
|
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() {
|
2024-02-01 16:00:16 +01:00
|
|
|
return 'The phone field requires a valid phone number'
|
2024-01-19 10:51:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
check(value) {
|
|
|
|
return /^(07|01)(\d){8}$/.test(value);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
theme: tailwind,
|
|
|
|
locales: { en },
|
|
|
|
locale: 'en',
|
|
|
|
floatPlaceholders: false,
|
|
|
|
rules: {
|
|
|
|
phone: phoneRule,
|
|
|
|
},
|
|
|
|
endpoints: {
|
|
|
|
registration: {
|
2024-02-05 08:27:33 +01:00
|
|
|
url: `https://pb.farmstar.grassecon.net/registration`,
|
2024-01-19 10:51:33 +01:00
|
|
|
method: 'post'
|
|
|
|
},
|
|
|
|
transaction: {
|
2024-02-05 08:27:33 +01:00
|
|
|
url: `https://pb.farmstar.grassecon.net/transaction`,
|
2024-01-19 10:51:33 +01:00
|
|
|
method: 'post'
|
|
|
|
},
|
|
|
|
farmer: {
|
2024-02-05 08:27:33 +01:00
|
|
|
url: `https://pb.farmstar.grassecon.net/farmer`,
|
2024-01-19 10:51:33 +01:00
|
|
|
method: 'post'
|
|
|
|
},
|
|
|
|
distributor: {
|
2024-02-05 08:27:33 +01:00
|
|
|
url: `https://pb.farmstar.grassecon.net/distributor`,
|
2024-01-19 10:51:33 +01:00
|
|
|
method: 'post'
|
2024-02-01 16:00:16 +01:00
|
|
|
},
|
|
|
|
redeem: {
|
2024-02-05 08:27:33 +01:00
|
|
|
url: `https://pb.farmstar.grassecon.net/redeem`,
|
2024-02-01 16:00:16 +01:00
|
|
|
method: 'post'
|
2024-01-19 10:51:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|