Adds liniting into the workflow (#3082)
* initial linting of src * fix indent to 2 spaces * Removes unnecessary rules * ignore spec folder for now * Spec linting * Fix spec indent * nits * nits * no no-empty rule
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import PromiseRouter from '../PromiseRouter';
|
||||
var request = require("request");
|
||||
var rest = require("../rest");
|
||||
var Auth = require("../Auth");
|
||||
import Parse from 'parse/node';
|
||||
|
||||
// TODO move validation logic in IAPValidationController
|
||||
const IAP_SANDBOX_URL = "https://sandbox.itunes.apple.com/verifyReceipt";
|
||||
@@ -59,7 +59,7 @@ function getFileForProductIdentifier(productIdentifier, req) {
|
||||
|
||||
export class IAPValidationRouter extends PromiseRouter {
|
||||
|
||||
handleRequest(req) {
|
||||
handleRequest(req) {
|
||||
let receipt = req.body.receipt;
|
||||
const productIdentifier = req.body.productIdentifier;
|
||||
|
||||
@@ -81,11 +81,11 @@ export class IAPValidationRouter extends PromiseRouter {
|
||||
}
|
||||
|
||||
function successCallback() {
|
||||
return getFileForProductIdentifier(productIdentifier, req);
|
||||
};
|
||||
return getFileForProductIdentifier(productIdentifier, req);
|
||||
}
|
||||
|
||||
function errorCallback(error) {
|
||||
return Promise.resolve({response: appStoreError(error.status) });
|
||||
return Promise.resolve({response: appStoreError(error.status) });
|
||||
}
|
||||
|
||||
return validateWithAppStore(IAP_PRODUCTION_URL, receipt).then( () => {
|
||||
@@ -95,10 +95,10 @@ export class IAPValidationRouter extends PromiseRouter {
|
||||
}, (error) => {
|
||||
if (error.status == 21007) {
|
||||
return validateWithAppStore(IAP_SANDBOX_URL, receipt).then( () => {
|
||||
return successCallback();
|
||||
}, (error) => {
|
||||
return errorCallback(error);
|
||||
}
|
||||
return successCallback();
|
||||
}, (error) => {
|
||||
return errorCallback(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user