Selaa lähdekoodia

added 家族データ保存・死亡判定

kuni 1 viikko sitten
vanhempi
commit
14fb751887

+ 1
- 0
src/app/models/family.ts Näytä tiedosto

@@ -11,4 +11,5 @@ export interface Family {
11 11
   motherId: string;
12 12
   spouseId: string;
13 13
   gender: string;
14
+  death: boolean;
14 15
 }

+ 1
- 0
src/app/pages/family-edit/family-edit.ts Näytä tiedosto

@@ -187,6 +187,7 @@ export class FamilyEdit implements OnInit {
187 187
       motherId: this.familyForm.value.motherId ?? '',
188 188
       spouseId: currentSpouseId,
189 189
       gender: this.familyForm.value.gender ?? 'unknown',
190
+      death: false,
190 191
     };
191 192
 
192 193
     if (spouseId) {

+ 3
- 1
src/app/pages/kakocho-edit/kakocho-edit.ts Näytä tiedosto

@@ -147,7 +147,9 @@ export class KakochoEdit implements OnInit {
147 147
       );
148 148
 
149 149
       if (this.sourceFamily) {
150
-        await this.familyService.deleteFamily(this.sourceFamily.id);
150
+        // await this.familyService.deleteFamily(this.sourceFamily.id);
151
+        this.sourceFamily.death = true;
152
+        await this.familyService.saveFamily(this.sourceFamily);
151 153
       }
152 154
     }
153 155
 

Loading…
Peruuta
Tallenna