mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
fix: add members to project use correct uri
This commit is contained in:
parent
cc54fad3a4
commit
37bd960133
@ -1,4 +1,5 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import projectApi from '../../store/project/api';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
Select,
|
||||
@ -32,8 +33,7 @@ function AddUserComponent({ roles, addUserToRole }) {
|
||||
if (q.length > 1) {
|
||||
setLoading(true);
|
||||
// TODO: Do not hard-code fetch here.
|
||||
const response = await fetch(`api/admin/user-admin/search?q=${q}`);
|
||||
const users = await response.json();
|
||||
const users = await projectApi.searchProjectUser(q);
|
||||
setOptions([...users]);
|
||||
} else {
|
||||
setOptions([]);
|
||||
|
@ -66,6 +66,10 @@ function validate(id) {
|
||||
}).then(throwIfNotSuccess);
|
||||
}
|
||||
|
||||
function searchProjectUser(query) {
|
||||
return fetch(`${formatApiPath('api/admin/user-admin/search')}?q=${query}`).then(res => res.json())
|
||||
}
|
||||
|
||||
export default {
|
||||
fetchAll,
|
||||
create,
|
||||
@ -75,4 +79,5 @@ export default {
|
||||
fetchAccess,
|
||||
addUserToRole,
|
||||
removeUserFromRole,
|
||||
searchProjectUser,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user