Exemplo n.º 1
0
    public async Task <IActionResult> SystemEmbed(string systemRef)
    {
        var system = await ResolveSystem(systemRef);

        if (system == null)
        {
            throw Errors.SystemNotFound;
        }

        return(Ok(APIJsonExt.EmbedJson(system.Name ?? $"System with ID `{system.Hid}`", "System")));
    }
Exemplo n.º 2
0
    public async Task <IActionResult> MemberEmbed(string memberRef)
    {
        var member = await ResolveMember(memberRef);

        if (member == null)
        {
            throw Errors.MemberNotFound;
        }
        var system = await _repo.GetSystem(member.System);

        var name = member.NameFor(LookupContext.ByNonOwner);

        if (system.Name != null)
        {
            name += $" ({system.Name})";
        }

        return(Ok(APIJsonExt.EmbedJson(name, "Member")));
    }
Exemplo n.º 3
0
    public async Task <IActionResult> GroupEmbed(string groupRef)
    {
        var group = await ResolveGroup(groupRef);

        if (group == null)
        {
            throw Errors.GroupNotFound;
        }
        var system = await _repo.GetSystem(group.System);

        var name = group.NameFor(LookupContext.ByNonOwner);

        if (system.Name != null)
        {
            name += $" ({system.Name})";
        }

        return(Ok(APIJsonExt.EmbedJson(name, "Group")));
    }