Large diffs are not rendered by default.

This file was deleted.

@@ -31,27 +31,27 @@ class LogIn extends Component {
render() {
// Notice how each input has a `value`, `name`, and `onChange` prop
return (
<div class = "container">
<div>
<p>
Enter Your Name and Password to Login {this.state.firstName} {this.state.lastName}
</p>
<form className="form">
<input class = "content"
<input className = "content"
value={this.state.firstName}
name="firstName"
onChange={this.handleInputChange}
type="text"
placeholder="First Name"
/>
<input class = "content"
<input className = "content"
value={this.state.lastName}
name="lastName"
onChange={this.handleInputChange}
type="text"
placeholder="Last Name"
/>

<input class = "content"
<input className = "content"
value={this.state.passWord}
name="passWord"
onChange={this.handleInputChange}
@@ -4,10 +4,16 @@ import GMap from '../../components/GMap';
import API from '../../utils/API';

class Map extends Component {
state = {
};
constructor(props) {
super(props);

this.getBathrooms = this.getBathrooms.bind(this);
this.state = {

};
}

getBathrooms = () => {
getBathrooms() {
API
.getBathrooms()
.then(res => {
@@ -18,18 +24,21 @@ class Map extends Component {
.catch(err => console.log(err));
};

componentDidMount() {
this.getBathrooms()
}

render() {
return (
<div>
<Alert>
<p>Notification for Map Page: Locations of all nearby bathrooms:</p>
</Alert>
<p>This is where we show the map.</p>
<button onClick={() => this.getBathrooms()}>Get Bathrooms</button>
<GMap/>
</div>
)
}
}

export default Map;
export default Map;
@@ -1,5 +1,6 @@
import React, { Component } from "react";
import "../SignUp/signup.css";
import React, {Component} from 'react';
import './signup.css';

class SignUp extends Component {
// Setting the component's initial state
state = {
@@ -46,33 +47,33 @@ class SignUp extends Component {
render() {
// Notice how each input has a `value`, `name`, and `onChange` prop
return (
<div class = "container">
<div>
<p id = "intro">
Sign up for My-Poopie! {this.state.firstName} {this.state.lastName}
</p>
<form className="form">
<input class = "content"
<input className = "content"
value={this.state.firstName}
name="firstName"
onChange={this.handleInputChange}
type="text"
placeholder="First Name"
/>
<input class = "content"
<input className = "content"
value={this.state.lastName}
name="lastName"
onChange={this.handleInputChange}
type="text"
placeholder="Last Name"
/>
<input class = "content"
<input className = "content"
value={this.state.password}
name="password"
onChange={this.handleInputChange}
type="password"
placeholder="Password"
/>
<button class = "button" onClick={this.handleFormSubmit}>SignUp</button>
<button className = "button" onClick={this.handleFormSubmit}>SignUp</button>
</form>
</div>
);
@@ -1 +1 @@
export { default } from "./SignUp.js";
export {default} from './SignUp.js';
@@ -2,7 +2,11 @@ import axios from 'axios';

export default {
// Gets all bathrooms
getBathrooms: function(params) {
getBathrooms: params => {
return axios.get('/api/bathrooms');
},

saveBathroom: bathroomData => {
return axios.post('/api/bathrooms', bathroomData);
}
};
};
@@ -6,5 +6,17 @@ module.exports = {
findAll: (req, res) => {
// find all the bathrooms either from an API or Mongo
res.send({message: 'find all bathrooms: need to work on this'})
},
create: (req, res) => {
const bathroom = {
_id: req.body.id,
name: req.body.name,
location: req.body.location
};

db.Bathroom
.create(bathroom)
.then(dbBathroom => res.json(dbBathroom))
.catch(err => res.status(422).json(err));
}
};
};
@@ -2,19 +2,19 @@ const db = require('../models');

// Defining methods for the userController
module.exports = {
findAll: function(req, res) {
findAll: (req, res) => {
res.send({message: 'need to work on this'})
},
findById: function(req, res) {
findById: (req, res) => {
res.send({message: 'need to work on this'})
},
create: function(req, res) {
create: (req, res) => {
res.send({message: 'need to work on this'})
},
update: function(req, res) {
update: (req, res) => {
res.send({message: 'need to work on this'})
},
remove: function(req, res) {
remove: (req, res) => {
res.send({message: 'need to work on this'})
}
};
};

This file was deleted.

@@ -2,11 +2,11 @@ const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const bathroomSchema = new Schema({
_id: { type: String, required: true },
name: { type: String, required: false },
location: { type: String, required: true },
date: { type: Date, default: Date.now }
}, { _id: false });
_id: {type: String, required: true},
name: {type: String, required: false},
location: {type: Object, required: true, coordinates: []},
date: {type: Date, default: Date.now}
}, {_id: false});

const Bathroom = mongoose.model('Bathroom', bathroomSchema);

@@ -2,11 +2,11 @@ const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const userSchema = new Schema({
_id: { type: String, required: true },
name: { type: String, required: true },
email: { type: String, required: true },
password: { type: String, required: true },
date: { type: Date, default: Date.now }
_id: { type: String, required: true },
name: { type: String, required: true },
email: { type: String, required: true },
password: { type: String, required: true },
date: { type: Date, default: Date.now }
}, { _id: false });

const User = mongoose.model('User', userSchema);

This file was deleted.

@@ -1,21 +1,21 @@
{
"name": "go-poopie",
"version": "0.0.0",
"main": "app.js",
"scripts": {
"server": "node app.js",
"client": "node scripts/start-client.js",
"start": "concurrently \"nodemon app.js\" \"npm run client\"",
"build": "node scripts/build.js"
},
"devDependencies": {
"concurrently": "^3.5.0",
"nodemon": "^1.12.5"
},
"dependencies": {
"body-parser": "^1.18.2",
"express": "^4.16.2",
"mongoose": "^4.13.3",
"request": "^2.83.0"
}
}
"name": "go-poopie",
"version": "1.0.0",
"main": "app.js",
"scripts": {
"server": "node app.js",
"client": "node scripts/start-client.js",
"start": "concurrently \"nodemon app.js\" \"npm run client\"",
"build": "node scripts/build.js"
},
"devDependencies": {
"concurrently": "^3.5.0",
"nodemon": "^1.12.5"
},
"dependencies": {
"body-parser": "^1.18.2",
"express": "^4.16.2",
"mongoose": "^4.13.3",
"request": "^2.83.0"
}
}
@@ -5,5 +5,6 @@ const bathroomController = require('../../controllers/bathroomController');
router
.route('/')
.get(bathroomController.findAll)
.post(bathroomController.create);

module.exports = router;