fix: Use team conversationURL in team section (#1921)

Fixes: #1917
This commit is contained in:
Pranav Raj S 2021-03-16 19:44:50 +05:30 committed by GitHub
parent e44e9fc025
commit 54d578676b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 13 deletions

View file

@ -5,13 +5,22 @@ export const frontendURL = (path, params) => {
return `/app/${path}${stringifiedParams}`;
};
export const conversationUrl = ({ accountId, activeInbox, id, label }) => {
export const conversationUrl = ({
accountId,
activeInbox,
id,
label,
teamId,
}) => {
if (activeInbox) {
return `accounts/${accountId}/inbox/${activeInbox}/conversations/${id}`;
}
if (label) {
return `accounts/${accountId}/label/${label}/conversations/${id}`;
}
if (teamId) {
return `accounts/${accountId}/team/${teamId}/conversations/${id}`;
}
return `accounts/${accountId}/conversations/${id}`;
};