mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
All changes i made
This commit is contained in:
@@ -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({
|
||||
selector: 'app-edit-action',
|
||||
@@ -40,6 +41,7 @@ export class EditActionPage implements OnInit {
|
||||
constructor(
|
||||
private publicationsService: PublicationsService,
|
||||
private toastService: ToastService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
) {
|
||||
this.folder = new PublicationFolder();
|
||||
}
|
||||
@@ -107,15 +109,11 @@ export class EditActionPage implements OnInit {
|
||||
await this.publicationsService.UpdatePresidentialAction(body).toPromise()
|
||||
this.close();
|
||||
this.updateDesktopComponent.emit();
|
||||
this.toastService._successMessage('Acção presidencial atualizada')
|
||||
this.httpErrorHandle.httpsSucessMessagge('Editar Acção')
|
||||
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 atualizar a acção presidencial')
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user