This file contains 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'; | |
/* eslint-disable no-param-reassign */ | |
module.exports.hello = function (context) { | |
context.log('JavaScript HTTP trigger function processed a request.'); | |
context.res = { | |
// status: 200, /* Defaults to 200 */ | |
body: 'Go Serverless v1.x! Your function executed successfully!', |
This file contains 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 React from 'react'; | |
import { MapView } from 'expo'; | |
export default class Maps extends React.Component { | |
render() { | |
return ( | |
<MapView | |
style={{ flex: 1 }} | |
initialRegion={{ | |
latitude: 37.78825, |
This file contains 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
// Aqui eu carrego os bets, e junto populo outras entidades como matche, user e etc... | |
// Dentro de Matche eu queria popular uma entidade chamada Team | |
// Como faco o populate de um populate? | |
const Bet = require("../models/bet"); | |
router.get("/", async (req, res) => { | |
try { | |
const bets = await Bet.find({ user: req.userId }).sort('-createdAt').populate(["matche", "user", "winner", "game", "tournament"]); |
This file contains 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 React, { Component, Fragment } from "react"; | |
import { connect } from "react-redux"; | |
import Feed from "./Feed"; | |
import FeaturedMatches from "./FeaturedMatches/FeaturedMatches"; | |
import BreadCrumb from "./layout/content/Breadcrumb"; | |
import Pagination from "./layout/utils/Pagination"; | |
import Social from "./layout/utils/Social"; | |
class Feeds extends Component { |
This file contains 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 React, { Component, Fragment } from "react"; | |
import Login from "../login/Login"; | |
import CadastroForm from "./CadastroForm" | |
import BreadCrumb from "../layout/content/Breadcrumb"; | |
import Alert from "../layout/utils/Alert"; | |
class Cadastro extends Component { | |
state = { |
This file contains 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
async index({ request, response, view }) { | |
const query = request.get(); | |
if(query.status) { | |
const matches = await Matche.query() | |
.with("tournament") | |
.with("game") | |
.with("team01") | |
.with("team02") |
This file contains 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 React, { Component } from "react"; | |
import { getPartidaById } from "../../api/StarttrekAPI"; | |
class EditarPartida extends Component { | |
componentDidMount() { | |
getPartidaById(this.props.match.params.id).then(data => { | |
console.log("A partida", data[0]); // | |
this.setState({ partida: data[0]}); |
This file contains 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 React, { Component } from "react"; | |
import Alert from "../layout/utils/Alert"; | |
class Cupom extends Component { | |
render() { | |
const { text } = this.state; | |
return ( | |
<div class="card"> |
This file contains 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 React, { Component, Fragment } from "react"; | |
import { BrowserRouter as Router, Route, Redirect } from "react-router-dom"; | |
import { connect } from "react-redux"; | |
import { handleInitialData } from "../actions/shared"; | |
import Dashboard from "./Dashboard"; | |
import Profile from "./Profile"; | |
const PrivateRoute = ({ component: Component, ...rest }) => ( | |
<Route |
This file contains 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 { authRef } from "../config/firebase"; | |
import { getUserByFirebaseId } from "../api/api"; | |
export const SET_AUTHED_USER = "SET_AUTHED_USER"; | |
export const FETCH_USER = "FETCH_USER"; | |
export function setAuthedUser(id) { | |
return { | |
type: SET_AUTHED_USER, | |
id |