feat: detect can edit request list
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s
This commit is contained in:
parent
56a63185a1
commit
92b4db45d2
2 changed files with 55 additions and 21 deletions
|
|
@ -16,6 +16,7 @@ import axios from 'axios';
|
|||
import useBranchStore from '../branch';
|
||||
import { Branch } from '../branch/types';
|
||||
import { getSignature, setSignature } from './signature';
|
||||
import { getUserId } from 'src/services/keycloak';
|
||||
|
||||
const branchStore = useBranchStore();
|
||||
|
||||
|
|
@ -38,6 +39,14 @@ const useUserStore = defineStore('api-user', () => {
|
|||
|
||||
const data = ref<Pagination<User[]>>();
|
||||
|
||||
async function fetchUserGroup(id?: string) {
|
||||
return await api
|
||||
.get<
|
||||
{ id: string; name: string; path: string }[]
|
||||
>(`/user/${id || getUserId()}/group`)
|
||||
.then((res) => res.data);
|
||||
}
|
||||
|
||||
async function fetchHqOption() {
|
||||
if (userOption.value.hqOpts.length === 0) {
|
||||
const res = await branchStore.fetchList({
|
||||
|
|
@ -334,6 +343,8 @@ const useUserStore = defineStore('api-user', () => {
|
|||
setSignature,
|
||||
|
||||
typeStats,
|
||||
|
||||
fetchUserGroup,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue