@@ -636,7 +636,7 @@ updateGroupChat uId (GroupChat gId (Jsonb perms) name) = commitedTransactionally
636636 let userPerm = fromMaybe minChatPermissions $ M.lookup uId perms'
637637 unless (isAdmin userPerm) $
638638 lift $ S.throwError $ S.err401
639− let newPerms = M.adjust (max userPerm) uId perms
639+ let newPerms = M.alter (Just . max userPerm . fromMaybe userPerm) uId perms
640640 void $ manipulateParams updateGroupChatQ (GroupChat gId (Jsonb newPerms) name)
641641
642642leaveGroupChat :: UserId -> GroupChatId -> StaticPQ ()