Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement comment (frontend + backend) #11

Merged
merged 4 commits into from
Apr 28, 2021
Merged

Conversation

ShkarupaDC
Copy link
Member

No description provided.

@ShkarupaDC ShkarupaDC changed the base branch from master to develop April 26, 2021 21:05
@ShkarupaDC ShkarupaDC changed the base branch from develop to feature/post April 26, 2021 21:06
"parentId" bigint,
"rawContent" text,
"postedAt" timestamp,
"updatedAt" timestamp,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indent

END IF;
RETURN QUERY EXECUTE format(
'SELECT
"Users"."username",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to use aliases for table names

type: 'object',
properties: {
id: { type: 'integer' },
parentId: { type: 'integer', nullable: true },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason to make the field nullable and required at the same time?

const formatComments = comments =>
comments.map(comment => {
const { username, imageURL, ...rest } = comment;
rest.author = { username, imageURL };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but how you will make a popup window (oh hover) with user information using only the image and username? maybe some additional information is needed?

return this.pg.update({
changes: {
rawContent,
updatedAt: new Date(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better to use CURRENT_TIMESTAMP inside DBMS?

import React from 'react';
import styled from 'styled-components';

import Header from './header';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's more explicit to use names like CommentHeader instead of just Header

import Header from './header';
import Footer from './footer';
import SideBlock from './side';
import MarkDown from '../cells/markdown';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the singular form to name components

`;

const MainBlock = styled.div`
width: 100%;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it required when the parent block has display: flex?

export default CommentThread;

const CommentList = styled.ul`
list-style: none;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to move it to the index.css as it looks like a global reset

export class CommentService {
static async getByParent(postId, parentId) {
const comments = await http.get(
`${API_HOST}/posts/${postId}/comments/${parentId ?? ''}`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no need to use API_HOST URL prefix as HttpService already do it

@vvkin vvkin merged commit 35a8d29 into feature/post Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants