mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
refactor(federation): Make references always have domains
Some checks failed
CodeQL Scan / Analyze (push) Failing after 0s
Deploy Docs to GitHub Pages / build (push) Failing after 0s
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Nix Build / check (push) Failing after 0s
Test Publish / build (client) (push) Failing after 0s
Test Publish / build (sdk) (push) Failing after 0s
Build Docker Images / lint (push) Has been cancelled
Build Docker Images / check (push) Has been cancelled
Build Docker Images / tests (push) Has been cancelled
Build Docker Images / detect-circular (push) Has been cancelled
Mirror to Codeberg / Mirror (push) Has been cancelled
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been cancelled
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been cancelled
Some checks failed
CodeQL Scan / Analyze (push) Failing after 0s
Deploy Docs to GitHub Pages / build (push) Failing after 0s
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Nix Build / check (push) Failing after 0s
Test Publish / build (client) (push) Failing after 0s
Test Publish / build (sdk) (push) Failing after 0s
Build Docker Images / lint (push) Has been cancelled
Build Docker Images / check (push) Has been cancelled
Build Docker Images / tests (push) Has been cancelled
Build Docker Images / detect-circular (push) Has been cancelled
Mirror to Codeberg / Mirror (push) Has been cancelled
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been cancelled
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been cancelled
This commit is contained in:
parent
df2a5ce260
commit
709e1c6087
22 changed files with 688 additions and 477 deletions
|
|
@ -19,7 +19,10 @@ type MaybePromise<T> = T | Promise<T>;
|
|||
export class EntitySorter {
|
||||
private readonly handlers: EntitySorterHandlers = new Map();
|
||||
|
||||
public constructor(private readonly jsonData: JSONObject) {}
|
||||
public constructor(
|
||||
private readonly jsonData: JSONObject,
|
||||
public instanceDomain: string,
|
||||
) {}
|
||||
|
||||
public on<T extends typeof Entity>(
|
||||
entity: T,
|
||||
|
|
@ -45,7 +48,7 @@ export class EntitySorter {
|
|||
|
||||
if (entity) {
|
||||
await this.handlers.get(entity)?.(
|
||||
await entity.fromJSON(this.jsonData),
|
||||
await entity.fromJSON(this.jsonData, this.instanceDomain),
|
||||
);
|
||||
} else {
|
||||
await defaultHandler?.();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue