All changes i made

This commit is contained in:
Eudes Inácio
2023-02-27 09:34:36 +01:00
77 changed files with 8025 additions and 6717 deletions
@@ -4,6 +4,7 @@ import * as moment from 'moment';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -36,7 +37,8 @@ export class NewActionPage implements OnInit {
constructor(
private publication: PublicationsService,
private toastService: ToastService
private toastService: ToastService,
private httpErrorHandle: HttpErrorHandle,
) {
this.folder = new PublicationFolder();
@@ -121,16 +123,11 @@ export class NewActionPage implements OnInit {
try {
await this.publication.CreatePublicationFolder(this.folder).toPromise()
this.close();
this.toastService._successMessage('Acção presidencial criada')
this.httpErrorHandle.httpsSucessMessagge('Acção criada')
this.getActions.emit()
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possivel criar a acção presidencial')
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}