Get Site Image for mobile app regression
MODIFY
src/server/rest/CentralRestServerService.ts
src/server/rest/CentralRestServerService.ts
@@ -144,8 +144,8 @@ class RequestMapper {
[ServerAction.SITE_AREAS]: SiteAreaService.handleGetSiteAreas.bind(this),
[ServerAction.SITE_AREA]: SiteAreaService.handleGetSiteArea.bind(this),
[ServerAction.SITE_AREA_CONSUMPTION]: SiteAreaService.handleGetSiteAreaConsumption.bind(this),
- // TODO: To remove the 'SITE_AREA_IMAGE' when new version of Mobile App will be released (> V1.3.22)
- [ServerAction.SITE_AREA_IMAGE]: SiteAreaService.handleGetSiteAreaImage.bind(this),
+ // TODO: To remove the 'SITE_IMAGE' when new version of Mobile App will be released (> V1.3.22)
+ [ServerAction.SITE_IMAGE]: SiteService.handleGetSiteImage.bind(this),
[ServerAction.USERS]: UserService.handleGetUsers.bind(this),
[ServerAction.USER_SITES]: UserService.handleGetSites.bind(this),
[ServerAction.USERS_IN_ERROR]: UserService.handleGetUsersInError.bind(this),

MODIFY
src/server/rest/v1/service/SiteAreaService.ts
src/server/rest/v1/service/SiteAreaService.ts
@@ -301,10 +301,6 @@ export default class SiteAreaService {
// Filter
const filteredRequest = SiteAreaSecurity.filterSiteImageRequest(req.query);
UtilsService.assertIdIsProvided(action, filteredRequest.ID, MODULE_NAME, 'handleGetSiteAreaImage', req.user);
- // TODO: To remove when new version of Mobile App will be released (> V1.3.22)
- if (req.user) {
- filteredRequest.TenantID = req.user.tenantID;
- }
// Get it
const siteAreaImage = await SiteAreaStorage.getSiteAreaImage(filteredRequest.TenantID, filteredRequest.ID);
// Return

MODIFY
src/server/rest/v1/service/SiteService.ts
src/server/rest/v1/service/SiteService.ts
@@ -438,6 +438,10 @@ export default class SiteService {
// Filter
const filteredRequest = SiteSecurity.filterSiteImageRequest(req.query);
UtilsService.assertIdIsProvided(action, filteredRequest.ID, MODULE_NAME, 'handleGetSiteImage', req.user);
+ // TODO: To remove when new version of Mobile App will be released (> V1.3.22)
+ if (req.user) {
+ filteredRequest.TenantID = req.user.tenantID;
+ }
// Get the image
const siteImage = await SiteStorage.getSiteImage(filteredRequest.TenantID, filteredRequest.ID);
// Return

Get Site Image for mobile app regression