fix: role name is error in role configure (#3618)
This commit is contained in:
parent
d708c93b22
commit
c5dd034452
@ -31,7 +31,6 @@ export const useAvailableActions = () => {
|
||||
|
||||
export const DataSourceTable = () => {
|
||||
const record = useRecord();
|
||||
console.log(record.key);
|
||||
return (
|
||||
<div>
|
||||
<SchemaComponentContext.Provider value={{ designable: false }}>
|
||||
|
@ -3,12 +3,12 @@ import React, { useContext } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useAPIClient, useRequest, SchemaComponent, useRecord } from '@nocobase/client';
|
||||
import { PermissionContext } from './PermisionProvider';
|
||||
import { CurrentRolesContext } from './';
|
||||
|
||||
export const RoleConfigure = () => {
|
||||
const { update, currentRecord } = useContext(PermissionContext);
|
||||
const { update } = useContext(PermissionContext);
|
||||
const { t } = useTranslation();
|
||||
const { key } = useRecord();
|
||||
|
||||
return (
|
||||
<SchemaComponent
|
||||
schema={{
|
||||
@ -18,12 +18,13 @@ export const RoleConfigure = () => {
|
||||
'x-component-props': {
|
||||
useValues: (options) => {
|
||||
const api = useAPIClient();
|
||||
const role = useContext(CurrentRolesContext);
|
||||
return useRequest(
|
||||
() =>
|
||||
api
|
||||
.resource(`dataSources/${key}/roles`)
|
||||
.get({
|
||||
filterByTk: currentRecord.name,
|
||||
filterByTk: role.name,
|
||||
})
|
||||
.then((res) => {
|
||||
const record = res?.data?.data;
|
||||
|
Loading…
Reference in New Issue
Block a user