Enhance branch selection with weather information and localization updates
- Updated FalukantService to include weather data in branch retrieval, enhancing user context. - Modified BranchSelection component to display current weather for selected branches, improving user experience. - Added weather translations in both English and German localization files for better accessibility. - Improved styling for weather information display in the frontend.
This commit is contained in:
@@ -485,12 +485,30 @@ class FalukantService extends BaseService {
|
||||
where: { falukantUserId: u.id },
|
||||
include: [
|
||||
{ model: BranchType, as: 'branchType', attributes: ['labelTr'] },
|
||||
{ model: RegionData, as: 'region', attributes: ['name'] }
|
||||
{
|
||||
model: RegionData,
|
||||
as: 'region',
|
||||
attributes: ['name'],
|
||||
include: [
|
||||
{
|
||||
model: Weather,
|
||||
as: 'weather',
|
||||
include: [
|
||||
{ model: WeatherType, as: 'weatherType', attributes: ['tr'] }
|
||||
],
|
||||
required: false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
attributes: ['id', 'regionId'],
|
||||
order: [['branchTypeId', 'ASC']]
|
||||
});
|
||||
return bs.map(b => ({ ...b.toJSON(), isMainBranch: u.mainBranchRegionId === b.regionId }));
|
||||
return bs.map(b => ({
|
||||
...b.toJSON(),
|
||||
isMainBranch: u.mainBranchRegionId === b.regionId,
|
||||
weather: b.region?.weather?.weatherType?.tr || null
|
||||
}));
|
||||
}
|
||||
|
||||
async createBranch(hashedUserId, cityId, branchTypeId) {
|
||||
|
||||
Reference in New Issue
Block a user