Flatten nested repos
This commit is contained in:
92
test/vuex/one-fo-registration-dev/api/area.js
Normal file
92
test/vuex/one-fo-registration-dev/api/area.js
Normal file
@@ -0,0 +1,92 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/clinic/fo/";
|
||||
|
||||
export async function search_province(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_province', {
|
||||
search: search
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_city(province_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_city', {
|
||||
search: search,
|
||||
province_id: province_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_district(city_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_district', {
|
||||
search: search,
|
||||
city_id: city_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_kelurahan(district_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_kelurahan', {
|
||||
search: search,
|
||||
district_id: district_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user