Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eshanholtz committed Mar 18, 2020
1 parent 177f6f8 commit 5a139ce
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 27 deletions.
9 changes: 4 additions & 5 deletions packages/client/src/classes/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const {
mergeData,
},
classes: {
ResponseError,
Response,
ResponseError,
},
} = require('@sendgrid/helpers');

Expand All @@ -36,7 +36,6 @@ class Client {

//Empty default request
this.defaultRequest = {
data: {},
baseURL: 'https://api.sendgrid.com/',
url: '',
method: 'GET',
Expand Down Expand Up @@ -97,9 +96,9 @@ class Client {
url: opts.uri || opts.url,
baseURL: opts.baseUrl,
method: opts.method,
data: opts.body || {},
params: opts.qs || {},
headers: opts.headers || {},
data: opts.body,
params: opts.qs,
headers: opts.headers,
};

//Merge data with empty request
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/request.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, RequestOptions } from "@sendgrid/helpers/classes/request";
import {Request, RequestOptions} from "@sendgrid/helpers/classes/request";

export { Request as ClientRequest };
export { RequestOptions };
export {Request as ClientRequest};
export {RequestOptions};
2 changes: 0 additions & 2 deletions packages/helpers/classes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const Attachment = require('./attachment');
const EmailAddress = require('./email-address');
const Mail = require('./mail');
const Personalization = require('./personalization');
const Request = require('./request');
const Response = require('./response');
const ResponseError = require('./response-error');
const Statistics = require('./statistics');
Expand All @@ -20,7 +19,6 @@ module.exports = {
EmailAddress,
Mail,
Personalization,
Request,
Response,
ResponseError,
Statistics,
Expand Down
15 changes: 0 additions & 15 deletions packages/helpers/classes/request.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/helpers/classes/response-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ResponseError extends Error {
//Set data
this.code = status;
this.message = statusText;
this.response = {headers, data};
this.response = {headers, body: data};

//Capture stack trace
if (!this.stack) {
Expand Down
2 changes: 1 addition & 1 deletion packages/mail/src/classes/mail-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class MailService {
const request = {
method: 'POST',
url: '/v3/mail/send',
data: body,
body,
};

//Send
Expand Down

0 comments on commit 5a139ce

Please sign in to comment.