Merge pull request #3635 from Majed6/originRelativeUrl

Fixed Bug: inconsistent use of relative/absolute URLs
This commit is contained in:
Lauri Ojansivu 2021-03-05 21:11:42 +02:00 committed by GitHub
commit e7d7ddd698
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 30 additions and 15 deletions

View file

@ -777,6 +777,9 @@ Boards.helpers({
absoluteUrl() {
return FlowRouter.url('board', { id: this._id, slug: this.slug });
},
originRelativeUrl() {
return FlowRouter.path('board', { id: this._id, slug: this.slug });
},
colorClass() {
return `board-color-${this.color}`;

View file

@ -758,6 +758,14 @@ Cards.helpers({
cardId: this._id,
});
},
originRelativeUrl() {
const board = this.board();
return FlowRouter.path('card', {
boardId: board._id,
slug: board.slug,
cardId: this._id,
});
},
canBeRestored() {
const list = Lists.findOne({

View file

@ -280,6 +280,10 @@ Lists.helpers({
const card = Cards.findOne({ listId: this._id });
return card && card.absoluteUrl();
},
originRelativeUrl() {
const card = Cards.findOne({ listId: this._id });
return card && card.originRelativeUrl();
},
remove() {
Lists.remove({ _id: this._id });
},