refactor: br id
This commit is contained in:
parent
db10c7619c
commit
55f26b3758
2 changed files with 41 additions and 10 deletions
|
|
@ -59,12 +59,19 @@ const useUserStore = defineStore('api-user', () => {
|
|||
const res = await branchStore.fetchById(id, {
|
||||
includeSubBranch: true,
|
||||
});
|
||||
if (res && res?.branch) {
|
||||
res.branch.map((item) => {
|
||||
userOption.value.brOpts.push({
|
||||
label: item.code,
|
||||
value: item.id,
|
||||
});
|
||||
|
||||
if (res && res.branch) {
|
||||
res.branch.forEach((item) => {
|
||||
const exists = userOption.value.brOpts.some(
|
||||
(opt) => opt.value === item.id,
|
||||
);
|
||||
|
||||
if (!exists) {
|
||||
userOption.value.brOpts.push({
|
||||
label: item.code,
|
||||
value: item.id,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue