admin(ui-api): add 'include' parameter to all requests
This commit is contained in:
parent
e123367f40
commit
9532ecf867
24 changed files with 48 additions and 48 deletions
|
@ -35,11 +35,11 @@ interface ctx {
|
|||
|
||||
export const Context = createContext<ctx>({ page: 1, setPage: () => 1 });
|
||||
|
||||
export default () => {
|
||||
export default (include: string[] = []) => {
|
||||
const { page } = useContext(Context);
|
||||
|
||||
return useSWR<PaginatedResult<Database>>([ 'databases', page ], async () => {
|
||||
const { data } = await http.get('/api/application/databases', { params: { page } });
|
||||
const { data } = await http.get('/api/application/databases', { params: { include: include.join(','), page } });
|
||||
|
||||
return ({
|
||||
items: (data.data || []).map(rawDataToDatabase),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue