Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getProvince = async () => {
- const response = await axios.get(`${process.env.MIX_BACKEND_IP}/api/get_province`);
- if (response.status === 200) {
- this.setState({
- provinceList: response.data.data,
- });
- }
- };
- getZipcode = async () => {
- const response = await axios.get(
- `${process.env.MIX_BACKEND_IP}/api/zipcode`,
- {
- params: {
- province: this.state.province,
- amphoe: this.state.amphoe,
- tambon: this.state.tambon,
- zipcode: this.state.zipcode,
- },
- },
- );
- if (response.status === 200) {
- this.setState({
- zipcodeList: response.data.data.zipcode,
- });
- }
- };
- getAmphoe = async () => {
- const response = await axios.get(
- `${process.env.MIX_BACKEND_IP}/api/zipcode`,
- {
- params: {
- province: this.state.province,
- amphoe: this.state.amphoe,
- tambon: this.state.tambon,
- zipcode: this.state.zipcode,
- },
- },
- );
- if (response.status === 200) {
- this.setState({
- amphoeList: response.data.data.amphoe,
- tambonList: response.data.data.tambon,
- zipcodeList: response.data.data.zipcode,
- });
- }
- };
- getTambon = async () => {
- const response = await axios.get(
- `${process.env.MIX_BACKEND_IP}/api/zipcode`,
- {
- params: {
- province: this.state.province,
- amphoe: this.state.amphoe,
- tambon: this.state.tambon,
- zipcode: this.state.zipcode,
- },
- },
- );
- if (response.status === 200) {
- this.setState({
- tambonList: response.data.data.tambon,
- });
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement