Added validation to check if user add image ou video and prevent to create publication withou it

This commit is contained in:
Eudes Inácio
2024-02-02 12:05:42 +01:00
parent 01f15f97ac
commit a5b29e330a
2 changed files with 172 additions and 182 deletions
@@ -405,6 +405,7 @@ export class NewPublicationPage implements OnInit {
if (this.Form.invalid) return false if (this.Form.invalid) return false
if (this.seletedContent.length != 0) {
if (this.publicationType == '3') { if (this.publicationType == '3') {
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -534,7 +535,6 @@ export class NewPublicationPage implements OnInit {
try { try {
await this.publications.CreatePublication(this.folderId, this.publication).toPromise(); await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
this.close(); this.close();
this.httpErrorHandle.httpsSucessMessagge('Criar publicação') this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
@@ -551,6 +551,10 @@ export class NewPublicationPage implements OnInit {
} }
this.PublicationFolderService.getPublicationsIds(this.folderId) this.PublicationFolderService.getPublicationsIds(this.folderId)
} else {
this.httpErrorHandle.validationMessagge("noFileSelected")
}
} }
File diff suppressed because one or more lines are too long