add isMember in wikis

This commit is contained in:
fantasticit 2022-05-18 21:49:50 +08:00
parent dac7667714
commit 83db0fe9ba
2 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,7 @@ const grid = {
const { Title } = Typography; const { Title } = Typography;
const Workspaces = ({ hook }) => { const Wikis = ({ hook }) => {
const { data, loading, error } = hook(); const { data, loading, error } = hook();
return ( return (
@ -65,13 +65,13 @@ const Page: NextPage = () => {
</Title> </Title>
<Tabs type="button" style={{ marginTop: 24 }}> <Tabs type="button" style={{ marginTop: 24 }}>
<TabPane tab="全部" itemKey="all"> <TabPane tab="全部" itemKey="all">
<Workspaces hook={useAllWikis} /> <Wikis hook={useAllWikis} />
</TabPane> </TabPane>
<TabPane tab="我创建的" itemKey="own"> <TabPane tab="我创建的" itemKey="own">
<Workspaces hook={useOwnWikis} /> <Wikis hook={useOwnWikis} />
</TabPane> </TabPane>
<TabPane tab="我参与的" itemKey="join"> <TabPane tab="我参与的" itemKey="join">
<Workspaces hook={useJoinWikis} /> <Wikis hook={useJoinWikis} />
</TabPane> </TabPane>
</Tabs> </Tabs>
</div> </div>

View File

@ -342,7 +342,7 @@ export class WikiService {
const ret = await Promise.all( const ret = await Promise.all(
data.map(async (wiki) => { data.map(async (wiki) => {
const createUser = await this.userService.findById(wiki.createUserId); const createUser = await this.userService.findById(wiki.createUserId);
return { ...wiki, createUser }; return { ...wiki, createUser, isMember: true };
}) })
); );
@ -368,7 +368,7 @@ export class WikiService {
const ret = await Promise.all( const ret = await Promise.all(
data.map(async (wiki) => { data.map(async (wiki) => {
const createUser = await this.userService.findById(wiki.createUserId); const createUser = await this.userService.findById(wiki.createUserId);
return { ...wiki, createUser }; return { ...wiki, createUser, isMember: true };
}) })
); );
@ -397,7 +397,7 @@ export class WikiService {
const ret = await Promise.all( const ret = await Promise.all(
data.map(async (wiki) => { data.map(async (wiki) => {
const createUser = await this.userService.findById(wiki.createUserId); const createUser = await this.userService.findById(wiki.createUserId);
return { ...wiki, createUser }; return { ...wiki, createUser, isMember: true };
}) })
); );