Skip to content

Commit

Permalink
fix(permissions): 🐛 Undefined slug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nudelsuppe42 committed Jun 2, 2024
1 parent 26c4a4b commit 1538ab0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/teams/[team]/manage/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const Settings = ({ data: tempData }: any) => {
const [allowSettings, setAllowSettings] = useState(false);

useEffect(() => {
setAllowSettings(permissions.has('team.settings.edit', data.slug));
setAllowSocial(permissions.has('team.socials.edit', data.slug));
setAllowSettings(permissions.has('team.settings.edit', data?.slug));
setAllowSocial(permissions.has('team.socials.edit', data?.slug));
}, [permissions]);

const handleSave = (e: any) => {
Expand Down Expand Up @@ -181,7 +181,7 @@ const Settings = ({ data: tempData }: any) => {
}}
seo={{ nofollow: true, noindex: true }}
requiredPermissions={{
buildteam: data.slug,
buildteam: data?.slug,
permissions: ['team.settings.edit', 'team.socials.edit'],
}}
loading={!data}
Expand Down

0 comments on commit 1538ab0

Please sign in to comment.