feat(auth): use Wayne native role APIs
This commit is contained in:
@@ -6,9 +6,14 @@ export interface UserOption {
|
||||
}
|
||||
|
||||
export const userApi = {
|
||||
async list(): Promise<UserOption[]> {
|
||||
async list(params: { businessLineId?: number } = {}): Promise<UserOption[]> {
|
||||
const token = getToken()
|
||||
const response = await fetch('/auth/api/v1/users', {
|
||||
const query = new URLSearchParams()
|
||||
if (params.businessLineId) {
|
||||
query.set('business_line_id', String(params.businessLineId))
|
||||
}
|
||||
const path = query.toString() ? `/auth/api/v1/users?${query}` : '/auth/api/v1/users'
|
||||
const response = await fetch(path, {
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
||||
|
||||
Reference in New Issue
Block a user