fix: role name is error in role configure (#3618)

This commit is contained in:
katherinehhh 2024-03-05 18:19:53 +08:00 committed by GitHub
parent d708c93b22
commit c5dd034452
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,6 @@ export const useAvailableActions = () => {
export const DataSourceTable = () => {
const record = useRecord();
console.log(record.key);
return (
<div>
<SchemaComponentContext.Provider value={{ designable: false }}>

View File

@ -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;