Fixed owner searching.

This commit is contained in:
Patrick Fic
2020-02-19 14:39:49 -08:00
parent f49f460a66
commit 2efbd48275
12 changed files with 46 additions and 13 deletions

View File

@@ -20,12 +20,7 @@ export default function OwnerFindModalContainer({
const ownersList = useQuery(QUERY_SEARCH_OWNER_BY_IDX, {
variables: {
search: owner
? `${owner.ownr_fn || ""} ${owner.ownr_ln || ""} ${owner.ownr_addr1 ||
""} ${owner.ownr_city || ""} ${owner.ownr_zip ||
""} ${owner.ownr_ea || ""} ${owner.ownr_ph1 ||
""} ${owner.ownr_ph2 || ""}`
: null
search: owner ? `${owner.ownr_fn || ""} ${owner.ownr_ln || ""}` : null
},
skip: !owner,
fetchPolicy: "network-only"
@@ -35,18 +30,17 @@ export default function OwnerFindModalContainer({
<Modal
title={t("owners.labels.existing_owners")}
width={"80%"}
{...modalProps}
>
{...modalProps}>
{loading ? <LoadingSpinner /> : null}
{error ? <AlertComponent message={error.message} type="error" /> : null}
{error ? <AlertComponent message={error.message} type='error' /> : null}
{owner ? (
<OwnerFindModalComponent
selectedOwner={selectedOwner}
setSelectedOwner={setSelectedOwner}
ownersListLoading={ownersList.loading}
ownersList={
ownersList.data && ownersList.data.search_owners
? ownersList.data.search_owners
ownersList.data && ownersList.data.search_owner
? ownersList.data.search_owner
: null
}
/>

View File

@@ -0,0 +1 @@
@import 'react-big-calendar/lib/sass/styles';

View File

@@ -1,7 +1,8 @@
import moment from "moment";
import React from "react";
import { Calendar, momentLocalizer } from "react-big-calendar";
import "react-big-calendar/lib/css/react-big-calendar.css";
//import "react-big-calendar/lib/css/react-big-calendar.css";
import "./schedule-calendar.styles.scss";
import DateCellWrapper from "../schedule-datecellwrapper/schedule-datecellwrapper.component";
import Event from "../schedule-event/schedule-event.container";
const localizer = momentLocalizer(moment);