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
BEGIN; | |
CREATE TABLE public.orders ( | |
order_id text PRIMARY KEY, | |
user_id text NOT NULL, | |
restaurant_id integer NOT NULL, | |
address text NOT NULL, | |
placed boolean DEFAULT false NOT NULL, | |
approved boolean DEFAULT false NOT NULL, | |
driver_assigned boolean DEFAULT false NOT NULL, |
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
server.post('/validate-order', async function (req, res) { | |
// console.log("Validate Order"); | |
try{ | |
var order; | |
console.log(req); | |
if(req.body.event) { | |
order = req.body.event.data.new; | |
} else { | |
order = req.body; | |
} |
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
const validateOrder = require('./backend/validate-order').validateOrder; | |
const makePayment = require('./backend/payment').makePayment; | |
const restaurantApproval = require('./backend/restaurant-approval').restaurantApproval; | |
const assignAgent = require('./backend/agent-assignment').assignAgent; |
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 { withData } from 'next-apollo' | |
import { HttpLink } from 'apollo-link-http' | |
const config = { | |
link: new HttpLink({ | |
uri: 'https://data.<cluster_name>.hasura-app.io/v1alpha1/graphql', | |
headers: { | |
'Authorization': `Bearer <token>`, | |
'X-Hasura-Role': 'admin' | |
}, |
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
const POSTGRES_CONNECTION_STRING = `postgres://${process.env.POSTGRES_USERNAME}:${process.env.POSTGRES_PASSWORD}@${process.env.POSTGRES_HOSTNAME}:${process.env.POSTGRES_PORT}/hasuradb`; |
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 gql from 'graphql-tag' | |
import React from 'react'; | |
import Link from 'next/link' | |
import { Query, Mutation } from "react-apollo"; | |
import withData from '../config'; | |
import Router from 'next/router' | |
import {Grid, Checkbox, Button} from 'react-bootstrap'; | |
const uuidv1 = require('uuid/v1'); |
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 {Table, Button, Grid} from 'react-bootstrap'; | |
import {Link} from 'next/link'; | |
import gql from "graphql-tag"; | |
import {Query,Subscription} from "react-apollo"; | |
import getStatus from '../components/GetStatus'; | |
import {withRouter} from 'next/router' | |
import withData from '../config'; |
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 gql from 'graphql-tag' | |
import { Query } from 'react-apollo' | |
import withData from '../config'; | |
import Link from 'next/link' | |
import React from 'react'; | |
import {Button, Grid, Jumbotron, | |
FormControl, FormGroup, ControlLabel, | |
HelpBlock} from 'react-bootstrap'; |
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
server.get('/Order/:id', (req, res) => { | |
const actualPage = '/Order' | |
const queryParams = { id: req.params.id } | |
app.render(req, res, actualPage, queryParams) | |
}) |
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 {withRouter} from 'next/router' | |
import withData from '../config'; | |
const Order = withRouter((props) => ( | |
<div> | |
.......... | |
{props.router.query.id} | |
........... | |
</div> | |
)) |
OlderNewer