feat(dashboard): add opengraph/oembed, Docker build

This commit is contained in:
spiral
2022-06-03 01:01:54 -04:00
parent d956bd4577
commit 15d48db6f3
12 changed files with 253 additions and 1 deletions

View File

@@ -97,6 +97,21 @@ public class GroupControllerV2: PKControllerBase
return Ok(group.ToJson(ContextFor(group), system.Hid));
}
[HttpGet("groups/{groupRef}/oembed.json")]
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"));
}
[HttpPatch("groups/{groupRef}")]
public async Task<IActionResult> DoGroupPatch(string groupRef, [FromBody] JObject data)
{