Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit bbf2008

Browse files
committed
subscription invite issue solved
1 parent f90795a commit bbf2008

1 file changed

Lines changed: 1 addition & 28 deletions

File tree

service/src/services/invite/invite.class.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -103,40 +103,19 @@ class Service {
103103
};
104104
resolve (errorObj);
105105
}
106-
// let user = await (self.updateuserdetails(userId,previous_packages,params));
107-
108-
return self.updateuserdetails(userId,previous_packages,params).then(r=>{
106+
return self.updateuserdetails(userId,previous_packages,params).then(r => {
109107
return {res:res,userDetail:r};
110108
});
111-
112-
// axios.put(baseUrl+'/user/updateuserdetails/' + userId, { package: previous_packages }, { headers: { 'Authorization': params.headers.authorization } })
113-
// .then(async ((result) => {
114-
// if (result.data.code == 201) {
115-
// let subscription_invite = await (self.subscription_invitation(data, res, params ));
116-
// self.sendEmail(data, res, params.headers.authorization);
117-
// }
118-
// resolve(result.data);
119-
// })).catch((err) => {
120-
// let errorObj = {};
121-
// errorObj.statusText = err.response.statusText;
122-
// errorObj.status = err.response.status;
123-
// errorObj.data = err.response.data;
124-
// resolve (errorObj);
125-
// /* eslint-disable no-undef */
126-
// });
127109
}).then(async ((result)=>{
128110
let userDetailResult=result.userDetail;
129111
let res=result.res;
130-
console.log('userDetailResult::::', userDetailResult) // eslint-disable-line
131112
if (userDetailResult.data.code == 201) {
132-
console.log('201::::', userDetailResult) // eslint-disable-line
133113
let subscription_invite = await (self.subscription_invitation(data, res, params ));
134114
self.sendEmail(data, res, params.headers.authorization);
135115
}
136116
resolve(userDetailResult.data);
137117
})).catch((err) => {
138118
let errorObj = {};
139-
console.log('Invite Create Catch:: ', err) // eslint-disable-line
140119
if (err.response.data === 'data not found!') {
141120
errorObj.statusText = 'Not Found';
142121
errorObj.status = 404;
@@ -167,16 +146,13 @@ class Service {
167146

168147
subscription_invitation(data, res, params) {
169148
let self = this;
170-
console.log('subscription_invitation::: ') // eslint-disable-line
171-
// return this.app.service('subscription-invitation').find({query : { 'toEmail': data.toEmail, 'subscriptionId': data.subscriptionId, 'isDeleted': false }, headers: { 'Authorization': params.headers.authorization }})
172149
// return axios.get(baseUrl+'/subscription/subscription-invitation', {query : { 'toEmail': data.toEmail, 'subscriptionId': data.subscriptionId, 'isDeleted': false }, headers: { 'Authorization': params.headers.authorization }})
173150
return axios({
174151
method: 'get',
175152
url: baseUrl+'/subscription/subscription-invitation?toEmail='+data.toEmail+'&subscriptionId='+data.subscriptionId+'&isDeleted=false',
176153
headers: { 'Authorization': params.headers.authorization }
177154
})
178155
.then(function (response) {
179-
console.log('response::', response) // eslint-disable-line
180156
if (response.data.data.length == 0) {
181157
return self.app.service('subscription-invitation').create(data).then(function (response){
182158
}).catch(function(err){
@@ -185,7 +161,6 @@ class Service {
185161
} else {
186162
response.data.data[0].isDeleted = true;
187163
return self.app.service('subscription-invitation').patch(response.data.data[0].id, response.data.data[0] , '').then(function (response2) {
188-
// console.log('response2-----' ,response2);
189164
self.app.service('subscription-invitation').create(data).then(function (response) {
190165
}).catch(function (err) {
191166
throw(err);
@@ -195,7 +170,6 @@ class Service {
195170
});
196171
}
197172
}).catch(function (err) {
198-
console.log('ERROR::', err) // eslint-disable-line
199173
throw(err);
200174
});
201175
}
@@ -205,7 +179,6 @@ class Service {
205179
SendEmailBody = SendEmailBody.replace(/DOMAIN/g, 'https://www.dashboard.' + domainKey);
206180
SendEmailBody = SendEmailBody.replace(/SYSTEMNAME/g, Object.keys(data.role)[0]);
207181
SendEmailBody = SendEmailBody.replace(/ROLE/g, Object.values(data.role)[0]);
208-
console.log('subscription_invitation::: ') // eslint-disable-line
209182
axios({ method: 'post',
210183
url: baseUrl+'/vmailmicro/sendEmail',
211184
headers: {'Authorization': authToken},

0 commit comments

Comments
 (0)