Skip to content

Commit

Permalink
Adding extra check for form_id and displaying messages in detailed vi…
Browse files Browse the repository at this point in the history
…ew (#1461)

* Adding extra check for form_id and displaying messages in detailed view

* Checking for form_id instead of post_content

* Moving checks around
  • Loading branch information
Angamanga authored Nov 15, 2024
1 parent 7aa8e5c commit 866f65f
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,13 @@ export class PostDetailsComponent extends BaseComponent implements OnChanges, On
private async getPost(id: number): Promise<void> {
if (!this.postId) return;
this.post = await this.getPostInformation(id);
if (this.post) {
this.surveyService.getById(this.post.form_id!).subscribe((form) => {
this.post!.form = form.result;
this.getData(this.post);
});
if (this.post && this.post.form_id) {
const form = await lastValueFrom(this.surveyService.getById(this.post.form_id!));
this.post.form = form.result;
this.getData(this.post);
this.preparePostForView();
//----------------------
//----------------------
} else {
this.postChanged = false;
}
}

Expand Down

0 comments on commit 866f65f

Please sign in to comment.