Update FalukantService to include character ID in attributes and enhance logging in PoliticsView for better debugging of character data retrieval.
This commit is contained in:
@@ -455,7 +455,7 @@ class FalukantService extends BaseService {
|
|||||||
{
|
{
|
||||||
model: FalukantCharacter,
|
model: FalukantCharacter,
|
||||||
as: 'character',
|
as: 'character',
|
||||||
attributes: ['birthdate', 'health'],
|
attributes: ['id', 'birthdate', 'health'],
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
model: Relationship,
|
model: Relationship,
|
||||||
|
|||||||
@@ -339,11 +339,17 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const { data } = await apiClient.get('/api/falukant/info');
|
const { data } = await apiClient.get('/api/falukant/info');
|
||||||
console.log('[PoliticsView] loadOwnCharacterId - API response:', data);
|
console.log('[PoliticsView] loadOwnCharacterId - API response:', data);
|
||||||
|
console.log('[PoliticsView] loadOwnCharacterId - data.character:', data.character);
|
||||||
|
console.log('[PoliticsView] loadOwnCharacterId - data.character?.id:', data.character?.id);
|
||||||
if (data.character && data.character.id) {
|
if (data.character && data.character.id) {
|
||||||
this.ownCharacterId = data.character.id;
|
this.ownCharacterId = data.character.id;
|
||||||
console.log('[PoliticsView] loadOwnCharacterId - Set ownCharacterId to:', this.ownCharacterId);
|
console.log('[PoliticsView] loadOwnCharacterId - Set ownCharacterId to:', this.ownCharacterId);
|
||||||
} else {
|
} else {
|
||||||
console.warn('[PoliticsView] loadOwnCharacterId - No character ID found in response');
|
console.warn('[PoliticsView] loadOwnCharacterId - No character ID found in response', {
|
||||||
|
hasCharacter: !!data.character,
|
||||||
|
characterKeys: data.character ? Object.keys(data.character) : null,
|
||||||
|
characterId: data.character?.id
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('[PoliticsView] Error loading own character ID', err);
|
console.error('[PoliticsView] Error loading own character ID', err);
|
||||||
|
|||||||
Reference in New Issue
Block a user