Skip to content

Commit

Permalink
fix: post setting
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Oct 20, 2023
1 parent 3a27340 commit 7d1d628
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mockServer/msw-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ export const buildMSWMocks = (
const memberId = getMemberIdFromToken(req.headers.get('Authorization'));
const member = await getMemberFromId(memberId);
const permission = await getPermissionForMember(memberId);
if (PermissionLevelCompare.lte(PermissionLevel.Write, permission)) {
console.log(permission, PermissionLevelCompare.lte(PermissionLevel.Write, permission));
if (PermissionLevel.Admin === permission) {
return res(ctx.status(403), ctx.json({ message: 'member can not admin' }));
}

Expand Down Expand Up @@ -219,6 +220,7 @@ export const buildMSWMocks = (
async (req, res, ctx) => {
const { id } = req.params;

// todo: check that is admin
const body: Pick<AppSetting, 'data' | 'id'> = await req.json();
const appSetting: Partial<MockAppSetting> = {
updatedAt: new Date(),
Expand Down

0 comments on commit 7d1d628

Please sign in to comment.