Merge pull request 'fix(salix): rollback updateClaim' (!2897) from hotfix_claimLink into master
Reviewed-on: #2897 Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
This commit is contained in:
commit
35009fdd6f
|
@ -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');
|
||||||
|
|
|
@ -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', {
|
||||||
|
|
|
@ -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/`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue