feat: scope select user to active branch only

This commit is contained in:
Methapon2001 2024-12-10 15:54:01 +07:00
parent db12f4f75e
commit 682d6cdae8
2 changed files with 12 additions and 17 deletions

View file

@ -48,6 +48,7 @@ watch(responsibleUserLocal, (lhs, rhs) => {
:params="{
userType: 'MESSENGER',
responsibleDistrictId: responsibleUserLocal ? districtId : undefined,
activeBranchOnly: true,
}"
:readonly
:label="$t('general.select', { msg: $t('personnel.MESSENGER') })"

View file

@ -198,23 +198,17 @@ const useUserStore = defineStore('api-user', () => {
});
}
async function fetchList(
opts?: {
page?: number;
pageSize?: number;
zipCode?: string;
query?: string;
includeBranch?: boolean;
userType?: string;
status?: Status;
responsibleDistrictId?: string;
},
flow?: {
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
async function fetchList(opts?: {
page?: number;
pageSize?: number;
zipCode?: string;
query?: string;
includeBranch?: boolean;
userType?: string;
status?: Status;
responsibleDistrictId?: string;
activeBranchOnly?: boolean;
}) {
const res = await api.get<Pagination<User[]>>(`/user`, { params: opts });
if (res && res.status === 200) {