This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import routes from 'routes' | |
| import Axios from 'axios' | |
| export const Client = { | |
| find(client_id) { | |
| var client_promise = new Promise((resolve, reject) => { | |
| axios.get(routes.RESOURCE_URL + client_id, (data) => { | |
| resolve(data); | |
| }) | |
| .catch((err) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Service from 'easy-requests' | |
| class Client extends Service | |
| { | |
| constructor(){ | |
| super(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Service from 'easy-requests' | |
| class Client extends Service | |
| { | |
| constructor(){ | |
| super(); | |
| this.config.endpoint = 'my-clients' | |
| //this.config.origin = 'https://myapi.com' | |
| //this.config.prefix = 'admin' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Service from 'easy-requests' | |
| export class Client extends Service { | |
| constructor() { | |
| super(); | |
| } | |
| static deactivate() { | |
| let ClientService = new Client(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Contracts\Routing\Middleware; | |
| use Illuminate\Http\Response; | |
| class CORS implements Middleware { | |
| /** | |
| * Handle an incoming request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| Object.defineProperty(exports, "__esModule", { | |
| value: true | |
| }); | |
| var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | |
| var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Client from 'services/Client.service' | |
| let myClients | |
| let client_promise = Client.get(); | |
| client_promise.then(response =>{ | |
| myClients = response | |
| }) | |
| .catch(error => { | |
| console.log("error: ", error) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Validator from 'laravalidator-js' | |
| let data = { | |
| email: "Cesar.23@@santana.com", //Wrong | |
| fullname: "Cesar A", | |
| age: "16", | |
| }; | |
| let rules = { | |
| fullname: ['required'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Validator from 'laravalidator-js' | |
| export class ClientValidator extends Validator | |
| { | |
| constructor(data) { | |
| super() | |
| this.rules = { | |
| fullname: ['required'], | |
| email: ['email'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ClientValidator from 'validators/Client.validator' | |
| let clientData = { | |
| fullname : 'Cesar Santana', | |
| email : 'example@@email.com', //Wrong | |
| age : 'asdf' //Wrong | |
| } | |
| let validation = ClientValidator.make(clientData) |