Skip to content

Commit

Permalink
Mongo endpoint updated
Browse files Browse the repository at this point in the history
  • Loading branch information
arackaf committed Mar 15, 2019
1 parent 8ef1f48 commit 3319ebd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -41,7 +41,7 @@
"lodash.sortby": "^4.7.0",
"mkdirp": "0.5.1",
"moment": "^2.13.0",
"mongo-graphql-starter": "^0.8.0-beta1",
"mongo-graphql-starter": "^0.9.0",
"mongodb": "3.1.13",
"multer": "1.1.0",
"nodemailer": "2.3.0",
Expand Down
50 changes: 25 additions & 25 deletions react-redux/modules/home/components/recommend/searchModal.tsx
@@ -1,13 +1,13 @@
import React, { FunctionComponent, useState, useContext, useEffect, useRef } from 'react';
import React, { FunctionComponent, useState, useContext, useEffect, useRef } from "react";

import Modal from 'applicationRoot/components/modal';
import SelectAvailableTags from 'applicationRoot/components/selectAvailableTags';
import DisplaySelectedTags from 'applicationRoot/components/displaySelectedTags';
import SelectAvailableSubjects from 'applicationRoot/components/selectAvailableSubjects';
import DisplaySelectedSubjects from 'applicationRoot/components/displaySelectedSubjects';
import Modal from "applicationRoot/components/modal";
import SelectAvailableTags from "applicationRoot/components/selectAvailableTags";
import DisplaySelectedTags from "applicationRoot/components/displaySelectedTags";
import SelectAvailableSubjects from "applicationRoot/components/selectAvailableSubjects";
import DisplaySelectedSubjects from "applicationRoot/components/displaySelectedSubjects";

import { TransitionGroup, CSSTransition } from 'react-transition-group';
import { SearchContext, ISearchBookRaw } from 'modules/home/searchState';
import { TransitionGroup, CSSTransition } from "react-transition-group";
import { SearchContext, ISearchBookRaw } from "modules/home/searchState";

interface LocalProps {
isOpen: boolean;
Expand Down Expand Up @@ -45,15 +45,15 @@ const SearchModal: FunctionComponent<Partial<LocalProps>> = props => {
const applyFilters = evt => {
evt.preventDefault();
setBookSearchState({
title: searchEl.current.value || void 0,
isRead: isReadE.current.checked ? void 0 : isRead0.current.checked ? false : true,
subjects: subjects.length ? subjects : void 0,
tags: tags.length ? tags : void 0,
title: searchEl.current.value || "",
isRead: isReadE.current.checked ? null : isRead0.current.checked ? false : true,
subjects: subjects.length ? subjects : null,
tags: tags.length ? tags : null,
searchChildSubjects: childSubEl.current.checked
});
};
return (
<Modal {...{ isOpen, onHide, headerCaption: 'Search your books' }}>
<Modal {...{ isOpen, onHide, headerCaption: "Search your books" }}>
<form onSubmit={applyFilters}>
<div className="row">
<div className="col-xs-6">
Expand All @@ -67,29 +67,29 @@ const SearchModal: FunctionComponent<Partial<LocalProps>> = props => {
<div className="form-group">
<label>Is read?</label>
<br />
<div style={{ display: 'inline' }} className="radio">
<div style={{ display: "inline" }} className="radio">
<label>
<input type="radio" defaultChecked={searchState.isRead == null} ref={isReadE} name="isRead" />
Either
</label>
</div>
<div style={{ display: 'inline', marginLeft: '20px' }} className="radio">
<div style={{ display: "inline", marginLeft: "20px" }} className="radio">
<label>
<input type="radio" defaultChecked={searchState.isRead == '1'} ref={isRead1} name="isRead" />
<input type="radio" defaultChecked={searchState.isRead == "1"} ref={isRead1} name="isRead" />
Yes
</label>
</div>
<div style={{ display: 'inline', marginLeft: '20px' }} className="radio">
<div style={{ display: "inline", marginLeft: "20px" }} className="radio">
<label>
<input type="radio" defaultChecked={searchState.isRead == '0'} ref={isRead0} name="isRead" />
<input type="radio" defaultChecked={searchState.isRead == "0"} ref={isRead0} name="isRead" />
No
</label>
</div>
</div>
</div>
</div>
</form>
<div className="row" style={{ position: 'relative' }}>
<div className="row" style={{ position: "relative" }}>
<div className="col-xs-3">
<SelectAvailableTags currentlySelected={tags} onSelect={selectTag} />
</div>
Expand All @@ -101,7 +101,7 @@ const SearchModal: FunctionComponent<Partial<LocalProps>> = props => {
</div>
<br />
<>
<div className="row" style={{ position: 'relative' }}>
<div className="row" style={{ position: "relative" }}>
<div className="col-xs-3">
<SelectAvailableSubjects currentlySelected={subjects} onSelect={selectSubject} />
</div>
Expand All @@ -111,7 +111,7 @@ const SearchModal: FunctionComponent<Partial<LocalProps>> = props => {
</div>
</div>
</div>
<div className="row" style={{ position: 'relative' }}>
<div className="row" style={{ position: "relative" }}>
<div className="col-xs-6">
<div className="checkbox">
<label>
Expand Down Expand Up @@ -144,7 +144,7 @@ const SearchResults = props => {
const loading = props.loading;

return (
<div style={{ maxHeight: '300px', overflowY: 'auto', marginTop: '5px' }}>
<div style={{ maxHeight: "300px", overflowY: "auto", marginTop: "5px" }}>
{books.length ? (
<table className="table table-condensed table-striped">
<thead>
Expand Down Expand Up @@ -182,20 +182,20 @@ const SearchResult: FunctionComponent<{ book: ISearchBookRaw }> = props => {
return (
<tr>
<td>
<button disabled={adding} onClick={selectBook} style={{ cursor: 'pointer' }} className="btn btn-primary">
<button disabled={adding} onClick={selectBook} style={{ cursor: "pointer" }} className="btn btn-primary">
Add to list&nbsp;
<i className="fal fa-plus" />
</button>
</td>
<td>
<img crossOrigin="anonymous" src={book.smallImage} />
<img src={book.smallImage} />
</td>
<td>
{book.title}
{book.authors && book.authors.length ? (
<>
<br />
<span style={{ fontStyle: 'italic' }}>{book.authors.join(', ')}</span>
<span style={{ fontStyle: "italic" }}>{book.authors.join(", ")}</span>
</>
) : null}
</td>
Expand Down

0 comments on commit 3319ebd

Please sign in to comment.