put in new console why is not save attachment person id < 0
This commit is contained in:
@@ -496,8 +496,9 @@ assignValue(item:Person): void {
|
||||
this._id = item.id;
|
||||
// this.messageService.add({severity:'success', summary: 'Save user', detail: item.firstName + " " + item.lastName });
|
||||
//this.router.navigate([this.returnUrl]);
|
||||
console.log("the person after save", item);
|
||||
|
||||
const list = this.getPhotoListforSave();
|
||||
console.log("the person after save photo, person", list, item);
|
||||
if (list.length > 0)
|
||||
{
|
||||
this.savePhotoList(list, item);
|
||||
@@ -734,22 +735,19 @@ savePhotoList(list: PersonPhotoDto[], item:Person): void {
|
||||
formData.append("files", file, file.name);
|
||||
}
|
||||
formData.append('personId', item.id.toString());
|
||||
|
||||
console.log("savephotolist person id", item.id, item);
|
||||
const personPhoto$ = this.personService.savePersonPhotoList(formData);
|
||||
this.subscription.add(personPhoto$.subscribe(
|
||||
{
|
||||
next: x => {
|
||||
if (x.statusCode == 1) {
|
||||
//const filename = x.data;
|
||||
//this.adminuserForm.patchValue({ image: filename });
|
||||
this.ref.close(item);
|
||||
//this.cdr.detectChanges();
|
||||
if (x.statusCode == 1) {
|
||||
this.ref.close(item);
|
||||
}
|
||||
else
|
||||
this.messageService.add({ severity: 'error', summary: 'Error save attach photos files', detail: 'Fail to photos file: ' + x.message });
|
||||
},
|
||||
error: e =>
|
||||
this.messageService.add({ severity: 'error', summary: 'Error attach photos file', detail: 'Fail to photos file: ' })
|
||||
this.messageService.add({ severity: 'error', summary: 'Error attach photos file', detail: 'Fail to photos file: ' })
|
||||
|
||||
}
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user