diff --git a/src/app/components/chat/chat.component.sass b/src/app/components/chat/chat.component.sass index cd1c90d..5ae8d7e 100644 --- a/src/app/components/chat/chat.component.sass +++ b/src/app/components/chat/chat.component.sass @@ -80,4 +80,12 @@ padding: 0.125em resize: none #send - @include gridPosition(1, 2, 2, 3) \ No newline at end of file + @include gridPosition(1, 2, 2, 3) + button + background-color: $cFeedChooserBackground + color: $cFontWhite + border: none + border-radius: 0.5em + button:hover + background-color: lighten($cFeedChooserBackground, 10%) + cursor: pointer \ No newline at end of file diff --git a/src/app/components/feed/postlist/postlist.component.ts b/src/app/components/feed/postlist/postlist.component.ts index 68fc3c0..7c2b612 100644 --- a/src/app/components/feed/postlist/postlist.component.ts +++ b/src/app/components/feed/postlist/postlist.component.ts @@ -18,14 +18,14 @@ export class PostlistComponent implements OnInit { ngOnInit() { } - voteUp(pPost: Post){ - this.feedService.upvote(pPost.id) - this.voteEvent.emit(true) + voteUp(pPost: Post) { + this.feedService.upvote(pPost.id).subscribe(response => { + this.voteEvent.emit(true)}) } - voteDown(pPost: Post){ - this.feedService.downvote(pPost.id) - this.voteEvent.emit(true) + voteDown(pPost: Post) { + this.feedService.downvote(pPost.id).subscribe(response => { + this.voteEvent.emit(true)}) } } diff --git a/src/app/services/chat/chat.service.ts b/src/app/services/chat/chat.service.ts index 7b6ef78..bc5e281 100644 --- a/src/app/services/chat/chat.service.ts +++ b/src/app/services/chat/chat.service.ts @@ -229,7 +229,7 @@ export class ChatService { } getBodyForSendMessage(pchatID: number, pContent: string) { - const body = {query: `mutation($chatID: number, $content: string) { + const body = {query: `mutation($chatID: ID!, $content: String!) { sendMessage(chatId: $chatID, content: $content) {id} }`, variables: { chatId: pchatID, diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index 235f8a4..d22df0e 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -42,7 +42,7 @@ export class FeedService { console.log(response.text())}) } - public upvote(pPostID: number): void { + public upvote(pPostID: number): any { let url = 'https://greenvironment.net/graphql' let headers = new Headers() @@ -54,11 +54,10 @@ export class FeedService { postId: pPostID }} - this.http.post(url, body).subscribe(response => { - console.log(response.text())}) + return this.http.post(url, body) } - public downvote(pPostID: number): void { + public downvote(pPostID: number): any { let url = 'https://greenvironment.net/graphql' let headers = new Headers() @@ -70,8 +69,7 @@ export class FeedService { postId: pPostID }} - this.http.post(url, body).subscribe(response => { - console.log(response.text())}) + return this.http.post(url, body) } public getAllPosts(): Array {