put in new console why is not save attachment person id < 0
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
,PC-KHAM/Kham,PC-KHAM,04.04.2026 22:40,file:///C:/Users/Kham/AppData/Roaming/LibreOffice/4;
|
|
||||||
@@ -72,6 +72,7 @@ namespace FamilyTreeAPI.Repository
|
|||||||
}
|
}
|
||||||
_context.PersonPhotos.Add(model);
|
_context.PersonPhotos.Add(model);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
result = model.Id;
|
||||||
|
|
||||||
statuscode = 1;
|
statuscode = 1;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
"AppSettings": {
|
"AppSettings": {
|
||||||
"Secret": "Nepean Blue Mountain Super Secret SIGN AND VERIFY JWT TOKENS, BEARER TOKEN USE WHEN CALLING THIS API.",
|
"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;",
|
"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",
|
"ImageFolder": "c:\\temp\\Family",
|
||||||
"ImportFolder": "c:\\temp"
|
"ImportFolder": "c:\\temp"
|
||||||
|
|||||||
@@ -496,8 +496,9 @@ assignValue(item:Person): void {
|
|||||||
this._id = item.id;
|
this._id = item.id;
|
||||||
// this.messageService.add({severity:'success', summary: 'Save user', detail: item.firstName + " " + item.lastName });
|
// this.messageService.add({severity:'success', summary: 'Save user', detail: item.firstName + " " + item.lastName });
|
||||||
//this.router.navigate([this.returnUrl]);
|
//this.router.navigate([this.returnUrl]);
|
||||||
console.log("the person after save", item);
|
|
||||||
const list = this.getPhotoListforSave();
|
const list = this.getPhotoListforSave();
|
||||||
|
console.log("the person after save photo, person", list, item);
|
||||||
if (list.length > 0)
|
if (list.length > 0)
|
||||||
{
|
{
|
||||||
this.savePhotoList(list, item);
|
this.savePhotoList(list, item);
|
||||||
@@ -734,22 +735,19 @@ savePhotoList(list: PersonPhotoDto[], item:Person): void {
|
|||||||
formData.append("files", file, file.name);
|
formData.append("files", file, file.name);
|
||||||
}
|
}
|
||||||
formData.append('personId', item.id.toString());
|
formData.append('personId', item.id.toString());
|
||||||
|
console.log("savephotolist person id", item.id, item);
|
||||||
const personPhoto$ = this.personService.savePersonPhotoList(formData);
|
const personPhoto$ = this.personService.savePersonPhotoList(formData);
|
||||||
this.subscription.add(personPhoto$.subscribe(
|
this.subscription.add(personPhoto$.subscribe(
|
||||||
{
|
{
|
||||||
next: x => {
|
next: x => {
|
||||||
if (x.statusCode == 1) {
|
if (x.statusCode == 1) {
|
||||||
//const filename = x.data;
|
|
||||||
//this.adminuserForm.patchValue({ image: filename });
|
|
||||||
this.ref.close(item);
|
this.ref.close(item);
|
||||||
//this.cdr.detectChanges();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this.messageService.add({ severity: 'error', summary: 'Error save attach photos files', detail: 'Fail to photos file: ' + x.message });
|
this.messageService.add({ severity: 'error', summary: 'Error save attach photos files', detail: 'Fail to photos file: ' + x.message });
|
||||||
},
|
},
|
||||||
error: e =>
|
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: ' })
|
||||||
|
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user