mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
All changes i made
This commit is contained in:
@@ -18,6 +18,7 @@ import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera
|
||||
|
||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { NgxImageCompressService } from "ngx-image-compress";
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
@@ -85,6 +86,7 @@ export class NewPublicationPage implements OnInit {
|
||||
private platform: Platform,
|
||||
private loadingCtrl: LoadingController,
|
||||
public imageCompress: NgxImageCompressService,
|
||||
private httpErrorHandle: HttpErrorHandle
|
||||
) {
|
||||
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
@@ -198,14 +200,14 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.pub.Title, [
|
||||
//Validators.required,
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
]),
|
||||
capturedImage: new FormControl(this.capturedImage, [
|
||||
|
||||
]),
|
||||
Message: new FormControl(this.pub.Message, [
|
||||
// Validators.required
|
||||
Validators.required,
|
||||
Validators.maxLength(1000)
|
||||
|
||||
])
|
||||
@@ -241,11 +243,11 @@ export class NewPublicationPage implements OnInit {
|
||||
try {
|
||||
|
||||
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.toastService._successMessage("Publicação editada")
|
||||
this.httpErrorHandle.httpsSucessMessagge('Publicação Editada')
|
||||
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService._badRequest("Publicação não editada")
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -269,11 +271,11 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.toastService._successMessage("Publicação criado")
|
||||
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
|
||||
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService._badRequest("Publicação não criado")
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -297,11 +299,11 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.toastService._successMessage("Publicação criado")
|
||||
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
|
||||
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService._badRequest("Publicação não criado")
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -333,12 +335,12 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
|
||||
this.close();
|
||||
this.toastService._successMessage("Publicação criado")
|
||||
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
|
||||
|
||||
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService._badRequest("Publicação não criado")
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user