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
@@ -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()
}