Skip to content

Commit

Permalink
fix disabled submit btn
Browse files Browse the repository at this point in the history
  • Loading branch information
HamoudaAmine committed May 16, 2019
1 parent 1c2c02d commit 758211b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions front-backOffice/src/app/add-site/add-site.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ export class AddSiteComponent implements OnInit, OnDestroy {
this.siteJson.path_file_guide_site = path_file_guide_site;
this.uploadNotice();
this.spinner.show();
console.log('spinner');
if (!this.id_site) {
this.sitesService.addSite(this.siteJson).subscribe(
(site) => {
Expand All @@ -247,6 +246,7 @@ export class AddSiteComponent implements OnInit, OnDestroy {
},
(err) => {
this.spinner.hide();
this.edit_btn = true;
if (err.status === 403) {
this.router.navigate(['']);
this.toastr.error('votre session est expirée', '', { positionClass: 'toast-bottom-right' });
Expand All @@ -259,9 +259,12 @@ export class AddSiteComponent implements OnInit, OnDestroy {
} else {
this.patchSite(this.siteJson, siteForm.value.id_theme, siteForm.value.id_stheme);
}
} else if (this.photos.length === 0) {
this.photoRequired = true;
} else {
this.edit_btn = true;
if (this.photos.length === 0)
this.photoRequired = true;
}

}

getPhoto(photo) {
Expand Down

0 comments on commit 758211b

Please sign in to comment.