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,
|
||||
as: 'character',
|
||||
attributes: ['birthdate', 'health'],
|
||||
attributes: ['id', 'birthdate', 'health'],
|
||||
include: [
|
||||
{
|
||||
model: Relationship,
|
||||
|
||||
@@ -339,11 +339,17 @@ export default {
|
||||
try {
|
||||
const { data } = await apiClient.get('/api/falukant/info');
|
||||
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) {
|
||||
this.ownCharacterId = data.character.id;
|
||||
console.log('[PoliticsView] loadOwnCharacterId - Set ownCharacterId to:', this.ownCharacterId);
|
||||
} 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) {
|
||||
console.error('[PoliticsView] Error loading own character ID', err);
|
||||
|
||||
Reference in New Issue
Block a user