From d2a142caa2dabcffcfd66cffc3d92045281cbc82 Mon Sep 17 00:00:00 2001 From: Louis Cherel Date: Wed, 17 Oct 2018 21:42:09 +0200 Subject: [PATCH] README.md: fix use of sudo --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 00847999..eb4e64ae 100644 --- a/README.md +++ b/README.md @@ -386,19 +386,15 @@ For example, if you want to disable notifications for a specific user: ```javascript import Gitlab from 'gitlab'; -const api = new Gitlab({ +const { NotificationSettings } = new Gitlab({ url: 'http://example.com', // Defaults to http://gitlab.com token: 'abcdefghij123456' // Can be created in your profile. + sudo: userid_or_username }); -api.NotificationSettings.headers.Sudo = userid_or_username; // eg: 1 or 'username' - await api.NotificationSettings.edit({ level: api.NotificationSettings.LEVELS.DISABLED }) - -delete api.NotificationSettings.headers.Sudo // clear impersonation header afterwards - ``` ## Migrating from node-gitlab/node-gitlab