File size: 772 Bytes
64a3c1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
namespace TaskTrackingSystem.Shared.Models.Notification;

public static class NotificationNavigation
{
    public static string BuildTargetUrl(string sourceType, long sourceId, byte notificationType)
    {
        if (string.Equals(sourceType, "project", StringComparison.OrdinalIgnoreCase))
        {
            return $"/projects/{sourceId}/tasks";
        }

        if (string.Equals(sourceType, "task", StringComparison.OrdinalIgnoreCase))
        {
            var isCommentThread = notificationType is (byte)NotificationType.CommentAdded or (byte)NotificationType.Mention;
            return isCommentThread
                ? $"/tasks/{sourceId}/details?tab=comments"
                : $"/tasks/{sourceId}/details";
        }

        return "/dashboard";
    }
}