mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Merge branch 'feat/webhooks' into main
This commit is contained in:
commit
b8e2ebd470
34 changed files with 920 additions and 39 deletions
|
|
@ -78,6 +78,14 @@ namespace PluralKit.API
|
|||
var newGroup = await _repo.CreateGroup(system.Id, patch.Name.Value, conn);
|
||||
newGroup = await _repo.UpdateGroup(newGroup.Id, patch, conn);
|
||||
|
||||
|
||||
_ = _dispatch.Dispatch(newGroup.Id, new UpdateDispatchData()
|
||||
{
|
||||
Event = DispatchEvent.CREATE_GROUP,
|
||||
EventData = patch.ToJson(),
|
||||
});
|
||||
|
||||
|
||||
await tx.CommitAsync();
|
||||
|
||||
return Ok(newGroup.ToJson(LookupContext.ByOwner));
|
||||
|
|
|
|||
|
|
@ -60,6 +60,12 @@ namespace PluralKit.API
|
|||
var newMember = await _repo.CreateMember(system.Id, patch.Name.Value, conn);
|
||||
newMember = await _repo.UpdateMember(newMember.Id, patch, conn);
|
||||
|
||||
_ = _dispatch.Dispatch(newMember.Id, new()
|
||||
{
|
||||
Event = DispatchEvent.CREATE_MEMBER,
|
||||
EventData = patch.ToJson(),
|
||||
});
|
||||
|
||||
await tx.CommitAsync();
|
||||
|
||||
return Ok(newMember.ToJson(LookupContext.ByOwner, v: APIVersion.V2));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue