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;
|
||||
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() {
|
||||
if (province.value) return province.value;
|
||||
|
|
@ -98,6 +104,7 @@ const useAddressStore = defineStore('api-address', () => {
|
|||
|
||||
return {
|
||||
fetchOffice,
|
||||
fetchOfficeById,
|
||||
fetchProvince,
|
||||
fetchDistrictByProvinceId,
|
||||
fetchSubDistrictByProvinceId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue