Skip to content

Commit

Permalink
fix find posts http/https
Browse files Browse the repository at this point in the history
  • Loading branch information
skorotkiewicz committed Apr 22, 2022
1 parent 7345ca0 commit e21ca9b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions client/src/components/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ const Comment = ({ comment, url, type = "" }) => {
}}
>
{(comment.votes && comment?.votes[0]?.voteType === 1) ||
(comment.Children.votes &&
(comment.Children &&
comment.Children.votes &&
comment?.Children?.votes[0]?.voteType === 1) ? (
<span style={{ color: "orange" }}>+</span>
) : (
Expand All @@ -112,7 +113,8 @@ const Comment = ({ comment, url, type = "" }) => {
}}
>
{(comment.votes && comment?.votes[0]?.voteType === 0) ||
(comment.Children.votes &&
(comment.Children &&
comment.Children.votes &&
comment?.Children?.votes[0]?.voteType === 0) ? (
<span style={{ color: "orange" }}>-</span>
) : (
Expand Down
6 changes: 3 additions & 3 deletions server/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ const getComments = async (req, res, next) => {
const page = await prisma.webpage.findFirst({
where: {
url: {
search: `${url}`,
endsWith: url,
},
},
select: {
Expand All @@ -368,7 +368,7 @@ const getComments = async (req, res, next) => {

where: {
webpageUrl: {
search: `${url}`,
endsWith: url,
},
parent_id: null,
},
Expand Down Expand Up @@ -465,7 +465,7 @@ const getCount = async (req, res, next) => {
const count = await prisma.webpage.findFirst({
where: {
url: {
search: `${url}`,
endsWith: url,
},
},
select: {
Expand Down
1 change: 0 additions & 1 deletion server/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ datasource db {

generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch", "fullTextIndex"]
}

model User {
Expand Down

0 comments on commit e21ca9b

Please sign in to comment.