SaiUpadhyayula / angular-reddit-clone

This repository contains source code for the Reddit Clone application built in Angular, the backend is built using Spring boot - https://github.com/SaiUpadhyayula/spring-reddit-clone
181 stars 152 forks source link

insert comment with username null #24

Open najiboulhouch opened 1 year ago

najiboulhouch commented 1 year ago

Hi @SaiUpadhyayula,

New comment was added with Null username, can you fix this in your code ?

My proposition was to add username from authservice that was stored in local storage.

ViewPostComponent file :

before :

      this.commentPayload = {
        text : '',
        postId : this.postId,
      };

after :

      this.commentPayload = {
        text : '',
        postId : this.postId,
        username : authService.getUsername(),
      };