PR touchups.
parent
be33e55d09
commit
fea0d1d142
|
@ -64,15 +64,13 @@ export default function TeamWebsitesTable({ teamId, data = [], onSave }) {
|
||||||
|
|
||||||
row.action = (
|
row.action = (
|
||||||
<Flexbox flex={1} justifyContent="end" gap={10}>
|
<Flexbox flex={1} justifyContent="end" gap={10}>
|
||||||
<Link href={`/websites/${websiteId}`}>
|
<Link href={`/websites/${websiteId}`} target="_blank">
|
||||||
<a target="_blank">
|
|
||||||
<Button>
|
<Button>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.External />
|
<Icons.External />
|
||||||
</Icon>
|
</Icon>
|
||||||
<Text>{formatMessage(labels.view)}</Text>
|
<Text>{formatMessage(labels.view)}</Text>
|
||||||
</Button>
|
</Button>
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
{canRemove && (
|
{canRemove && (
|
||||||
<Button onClick={() => handleRemoveWebsite(teamWebsiteId)}>
|
<Button onClick={() => handleRemoveWebsite(teamWebsiteId)}>
|
||||||
|
|
|
@ -120,7 +120,6 @@ model TeamWebsite {
|
||||||
|
|
||||||
team Team @relation(fields: [teamId], references: [id])
|
team Team @relation(fields: [teamId], references: [id])
|
||||||
website Website @relation(fields: [websiteId], references: [id])
|
website Website @relation(fields: [websiteId], references: [id])
|
||||||
userId String? @db.Uuid
|
|
||||||
|
|
||||||
@@index([teamId])
|
@@index([teamId])
|
||||||
@@index([websiteId])
|
@@index([websiteId])
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { PERMISSIONS, ROLE_PERMISSIONS, SHARE_TOKEN_HEADER } from 'lib/constants
|
||||||
import { secret } from 'lib/crypto';
|
import { secret } from 'lib/crypto';
|
||||||
import { ensureArray, parseSecureToken, parseToken } from 'next-basics';
|
import { ensureArray, parseSecureToken, parseToken } from 'next-basics';
|
||||||
import { getTeamUser } from 'queries';
|
import { getTeamUser } from 'queries';
|
||||||
import { getTeamWebsite, getTeamWebsiteByWebsiteIdUserId } from 'queries/admin/teamWebsite';
|
import { getTeamWebsite, getTeamWebsiteByTeamMemberId } from 'queries/admin/teamWebsite';
|
||||||
import { validate } from 'uuid';
|
import { validate } from 'uuid';
|
||||||
import { Auth } from './types';
|
import { Auth } from './types';
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ export async function canViewWebsite({ user, shareToken }: Auth, websiteId: stri
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const teamWebsite = await getTeamWebsiteByWebsiteIdUserId(websiteId, user.id);
|
const teamWebsite = await getTeamWebsiteByTeamMemberId(websiteId, user.id);
|
||||||
|
|
||||||
if (teamWebsite) {
|
if (teamWebsite) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -18,7 +18,7 @@ export async function getTeamWebsite(teamWebsiteId: string): Promise<
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getTeamWebsiteByWebsiteIdUserId(
|
export async function getTeamWebsiteByTeamMemberId(
|
||||||
websiteId: string,
|
websiteId: string,
|
||||||
userId: string,
|
userId: string,
|
||||||
): Promise<TeamWebsite> {
|
): Promise<TeamWebsite> {
|
||||||
|
|
Loading…
Reference in New Issue