Appointment with Mongo
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import AppointmentList from './AppointmentList';
|
||||
import CreateLink from './CreateAppointment'
|
||||
import CreateAppointment from './CreateAppointment'
|
||||
import Header from './Header';
|
||||
import Login from './Login'
|
||||
import Search from './Search';
|
||||
@@ -19,7 +19,7 @@ const App = () => {
|
||||
<Route
|
||||
exact
|
||||
path="/create"
|
||||
component={CreateLink}
|
||||
component={CreateAppointment}
|
||||
/>
|
||||
<Route exact path="/login" component={Login} />
|
||||
<Route exact path="/search" component={Search} />
|
||||
@@ -34,31 +34,4 @@ const App = () => {
|
||||
);
|
||||
};
|
||||
|
||||
// class App extends Component {
|
||||
// render() {
|
||||
// return <CreateLink />;
|
||||
// }
|
||||
// }
|
||||
|
||||
// function App() {
|
||||
// return (
|
||||
// <div className="App">
|
||||
// <header className="App-header">
|
||||
// <img src={logo} className="App-logo" alt="logo" />
|
||||
// <p>
|
||||
// Edit <code>src/App.js</code> and save to reload.
|
||||
// </p>
|
||||
// <a
|
||||
// className="App-link"
|
||||
// href="https://reactjs.org"
|
||||
// target="_blank"
|
||||
// rel="noopener noreferrer"
|
||||
// >
|
||||
// Learn React
|
||||
// </a>
|
||||
// </header>
|
||||
// </div>
|
||||
// );
|
||||
// }
|
||||
|
||||
export default App;
|
||||
|
||||
@@ -61,7 +61,7 @@ const getQueryVariables = (isNewPage, page) => {
|
||||
const skip = isNewPage ? (page - 1) * APPOINTMENTS_PER_PAGE : 0;
|
||||
const take = isNewPage ? APPOINTMENTS_PER_PAGE : 100;
|
||||
const orderBy = { createdAt: 'desc' };
|
||||
console.log(isNewPage, page, APPOINTMENTS_PER_PAGE, skip, take, orderBy);
|
||||
|
||||
return { take, skip, orderBy };
|
||||
};
|
||||
|
||||
@@ -78,8 +78,6 @@ const AppointmentList = () => {
|
||||
pageIndexParams[pageIndexParams.length - 1]
|
||||
);
|
||||
|
||||
console.log(pageIndexParams.length, page);
|
||||
|
||||
const pageIndex = page ? (page - 1) * APPOINTMENTS_PER_PAGE : 0;
|
||||
|
||||
const {
|
||||
|
||||
@@ -6,14 +6,14 @@ import { FEED_QUERY } from './AppointmentList';
|
||||
|
||||
const CREATE_APPOINTMENT_MUTATION = gql`
|
||||
mutation CreateAppointmentMutation(
|
||||
$title: String!
|
||||
$description: String!
|
||||
$url: String!
|
||||
) {
|
||||
createAppointment(description: $description, url: $url) {
|
||||
createAppointment(title: $title, description: $description) {
|
||||
id
|
||||
createdAt
|
||||
url
|
||||
title
|
||||
description
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user