mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
core: allow changing marketing emails consent settings
This commit is contained in:
committed by
Abdullah Atta
parent
49e7bdf202
commit
ab29a01649
@@ -309,6 +309,20 @@ class UserManager {
|
||||
});
|
||||
}
|
||||
|
||||
async changeMarketingConsent(enabled) {
|
||||
let token = await this.tokenManager.getAccessToken();
|
||||
if (!token) return;
|
||||
|
||||
await http.patch(
|
||||
`${constants.AUTH_HOST}${ENDPOINTS.patchUser}`,
|
||||
{
|
||||
type: "change_marketing_consent",
|
||||
enabled: enabled
|
||||
},
|
||||
token
|
||||
);
|
||||
}
|
||||
|
||||
resetPassword(newPassword) {
|
||||
return this._updatePassword("reset_password", {
|
||||
new_password: newPassword
|
||||
|
||||
@@ -36,6 +36,7 @@ const _ignore = "";
|
||||
* id: string,
|
||||
* email: string,
|
||||
* isEmailConfirmed: boolean,
|
||||
* marketingConsent: boolean,
|
||||
* mfa: {
|
||||
* isEnabled: boolean,
|
||||
* primaryMethod: string,
|
||||
|
||||
Reference in New Issue
Block a user