create comment from comment form

This commit is contained in:
Tykayn 2022-02-15 12:37:37 +01:00 committed by tykayn
parent 5d25754c16
commit eb1fffb628
2 changed files with 3 additions and 3 deletions

View File

@ -143,7 +143,7 @@ export class ApiService {
public createComment(slug: string, comment: Comment | CommentDTO): Promise<string> { public createComment(slug: string, comment: Comment | CommentDTO): Promise<string> {
try { try {
return this.axiosInstance.post(`${this.baseHref}/comments/poll/${slug}`, comment); return this.axiosInstance.post(`${this.baseHref}/comment/poll/${slug}`, comment);
} catch (error) { } catch (error) {
ApiService.handleError(error); ApiService.handleError(error);
} }

View File

@ -40,8 +40,8 @@ export class CommentsComponent {
} }
addComment() { addComment() {
this.api this.pollService
.createComment(this.pollService._poll.getValue().custom_url, { .addComment({
pseudo: this.storageService.vote_stack.pseudo, pseudo: this.storageService.vote_stack.pseudo,
text: this.storageService.vote_stack.comment, text: this.storageService.vote_stack.comment,
}) })