diff --git a/.~lock.document_Install.docx# b/.~lock.document_Install.docx# deleted file mode 100644 index 23ccb66..0000000 --- a/.~lock.document_Install.docx# +++ /dev/null @@ -1 +0,0 @@ -,PC-KHAM/Kham,PC-KHAM,04.04.2026 22:40,file:///C:/Users/Kham/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/API/FamilyTreeAPI/Repository/PersonPhotoRepository.cs b/API/FamilyTreeAPI/Repository/PersonPhotoRepository.cs index 5945de0..1f054d4 100644 --- a/API/FamilyTreeAPI/Repository/PersonPhotoRepository.cs +++ b/API/FamilyTreeAPI/Repository/PersonPhotoRepository.cs @@ -72,6 +72,7 @@ namespace FamilyTreeAPI.Repository } _context.PersonPhotos.Add(model); await _context.SaveChangesAsync(); + result = model.Id; statuscode = 1; diff --git a/API/FamilyTreeAPI/appsettings.json b/API/FamilyTreeAPI/appsettings.json index 9039aff..a2d934c 100644 --- a/API/FamilyTreeAPI/appsettings.json +++ b/API/FamilyTreeAPI/appsettings.json @@ -3,7 +3,8 @@ "AppSettings": { "Secret": "Nepean Blue Mountain Super Secret SIGN AND VERIFY JWT TOKENS, BEARER TOKEN USE WHEN CALLING THIS API.", "SQLConnectionString0": "host=localhost;port=5432;database=FamilyTreeDB;username=postgres;password=Positive~1;", - "SQLConnectionString": "host=192.168.1.102;port=5432;database=FamilyTreeDB;username=postgres;password=Positive~1;", + "SQLConnectionString": "host=192.168.1.240;port=5432;database=FamilyTreeDB;username=postgres;password=Positive~1;", + "ImageFolder": "c:\\temp\\Family", "ImportFolder": "c:\\temp" diff --git a/UI/src/app/person/person.edit.ts b/UI/src/app/person/person.edit.ts index 13b71eb..55b6960 100644 --- a/UI/src/app/person/person.edit.ts +++ b/UI/src/app/person/person.edit.ts @@ -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: ' }) } )); diff --git a/document_Install.docx b/document_Install.docx index 83b7976..f2001e3 100644 Binary files a/document_Install.docx and b/document_Install.docx differ