Refactor character affiliations to singular form
- Updated character data structure to replace 'affiliations' and 'frAffiliations' with 'affiliation' and 'frAffiliation'. - Modified related functions and components to accommodate the new structure. - Adjusted database schema and server-side logic to reflect the changes in character affiliation handling. - Ensured all references in the UI components and data import/export scripts are updated accordingly.
This commit is contained in:
@@ -28,8 +28,8 @@ type CharacterRecord = {
|
||||
frName?: string | null;
|
||||
gender?: string | null;
|
||||
age?: number | null;
|
||||
affiliations?: string[] | string | null;
|
||||
frAffiliations?: string[] | string | null;
|
||||
affiliation?: string | null;
|
||||
frAffiliation?: string | null;
|
||||
devilFruitId?: string | null;
|
||||
hakiObservation?: boolean;
|
||||
hakiArmament?: boolean;
|
||||
@@ -123,8 +123,8 @@ function transformCharacterData(item: CharacterRecord) {
|
||||
frName: toNullable(item.frName),
|
||||
gender: toNullable(item.gender),
|
||||
age: toNullable(item.age),
|
||||
affiliations: toJsonArray(item.affiliations),
|
||||
frAffiliations: toJsonArray(item.frAffiliations),
|
||||
affiliation: toNullable(item.affiliation),
|
||||
frAffiliation: toNullable(item.frAffiliation),
|
||||
devilFruitId: toNullable(item.devilFruitId),
|
||||
hakiObservation: !!item.hakiObservation,
|
||||
hakiArmament: !!item.hakiArmament,
|
||||
@@ -369,8 +369,8 @@ async function importFromJson(): Promise<void> {
|
||||
frName: row.frName,
|
||||
gender: row.gender,
|
||||
age: row.age,
|
||||
affiliations: row.affiliations,
|
||||
frAffiliations: row.frAffiliations,
|
||||
affiliation: row.affiliation,
|
||||
frAffiliation: row.frAffiliation,
|
||||
devilFruitId: row.devilFruitId,
|
||||
hakiObservation: row.hakiObservation,
|
||||
hakiArmament: row.hakiArmament,
|
||||
|
||||
Reference in New Issue
Block a user