fix(salix): rollback updateClaim #2897

Merged
carlossa merged 3 commits from hotfix_claimLink into master 2024-08-28 09:35:23 +00:00
3 changed files with 6 additions and 4 deletions

View File

@ -56,6 +56,8 @@ export default class App {
} }
getUrl(route, appName = 'lilium') { getUrl(route, appName = 'lilium') {
const index = window.location.hash.indexOf(route.toLowerCase());
const newRoute = index < 0 ? route : window.location.hash.substring(index);
const env = process.env.NODE_ENV; const env = process.env.NODE_ENV;
const filter = { const filter = {
where: {and: [ where: {and: [
@ -67,7 +69,7 @@ export default class App {
return this.logger.$http.get('Urls/findOne', {filter}) return this.logger.$http.get('Urls/findOne', {filter})
.then(res => { .then(res => {
if (res && res.data) if (res && res.data)
return res.data.url + route; return res.data.url + newRoute;
}) })
.catch(() => { .catch(() => {
this.showError('Direction not found'); this.showError('Direction not found');

View File

@ -108,7 +108,7 @@ module.exports = Self => {
async function notifyStateChange(ctx, workerId, claim, newState) { async function notifyStateChange(ctx, workerId, claim, newState) {
const models = Self.app.models; const models = Self.app.models;
const url = await models.Url.getUrl('lilium'); const url = await models.Url.getUrl();
const $t = ctx.req.__; const $t = ctx.req.__;
const message = $t(`Claim state has changed to`, { const message = $t(`Claim state has changed to`, {
@ -122,7 +122,7 @@ module.exports = Self => {
async function notifyPickUp(ctx, workerId, claim) { async function notifyPickUp(ctx, workerId, claim) {
const models = Self.app.models; const models = Self.app.models;
const url = await models.Url.getUrl('lilium'); const url = await models.Url.getUrl();
const $t = ctx.req.__; // $translate const $t = ctx.req.__; // $translate
const message = $t('Claim will be picked', { const message = $t('Claim will be picked', {

View File

@ -7,7 +7,7 @@ export default class Claim extends ModuleMain {
} }
async $onInit() { async $onInit() {
this.$state.go('home'); this.$state.go('home');
window.location.href = await this.vnApp.getUrl(`Claim/`); window.location.href = await this.vnApp.getUrl(`claim/`);
} }
} }