refactor: create fetch office by id
This commit is contained in:
parent
b1d08b19ee
commit
fda0d581ae
1 changed files with 7 additions and 0 deletions
|
|
@ -55,6 +55,12 @@ const useAddressStore = defineStore('api-address', () => {
|
||||||
if (res.status >= 400) return null;
|
if (res.status >= 400) return null;
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
async function fetchOfficeById(id: string) {
|
||||||
|
const res = await api.get<Office>(`/employment-office/${id}`);
|
||||||
|
|
||||||
|
if (res.status >= 400) return null;
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
|
||||||
async function fetchProvince() {
|
async function fetchProvince() {
|
||||||
if (province.value) return province.value;
|
if (province.value) return province.value;
|
||||||
|
|
@ -98,6 +104,7 @@ const useAddressStore = defineStore('api-address', () => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
fetchOffice,
|
fetchOffice,
|
||||||
|
fetchOfficeById,
|
||||||
fetchProvince,
|
fetchProvince,
|
||||||
fetchDistrictByProvinceId,
|
fetchDistrictByProvinceId,
|
||||||
fetchSubDistrictByProvinceId,
|
fetchSubDistrictByProvinceId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue