Skip to content

Commit

Permalink
fix: make grantedUsers optional in IPage interface and handle potenti…
Browse files Browse the repository at this point in the history
…al null in page route
  • Loading branch information
miya committed Jan 8, 2025
1 parent eeabc23 commit a92911c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/app/src/server/routes/apiv3/page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ module.exports = (crowi) => {
} = page;
let isGrantNormalized = false;
try {
const grantedUsersId = grantedUsers.map(ref => getIdForRef(ref));
const grantedUsersId = grantedUsers?.map(ref => getIdForRef(ref));
isGrantNormalized = await pageGrantService.isGrantNormalized(req.user, path, grant, grantedUsersId, grantedGroups, false, false);
}
catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/interfaces/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type IPage = {
descendantCount: number,
isEmpty: boolean,
grant: PageGrant,
grantedUsers: Ref<IUser>[],
grantedUsers?: Ref<IUser>[],
grantedGroups: IGrantedGroup[],
lastUpdateUser?: Ref<IUser>,
liker: Ref<IUser>[],
Expand Down

0 comments on commit a92911c

Please sign in to comment.