Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions packages/host/app/services/realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ export interface RealmPrivateDependencyReport {
warningTypes?: PublishabilityWarningType[];
}

type RealmInfoProperty = 'backgroundURL' | 'iconURL';

type AuthStatus =
| { type: 'logged-in'; token: string; claims: JWTPayload }
| { type: 'anonymous' };
Expand Down Expand Up @@ -498,45 +496,6 @@ class RealmResource {
});
});

async setRealmInfoProperty(
property: RealmInfoProperty,
value: string | null,
): Promise<void> {
await this.loginTask.perform();
let headers: Record<string, string> = {
Accept: SupportedMimeType.JSON,
Authorization: `Bearer ${this.token}`,
};
let response = await this.network.authedFetch(`${this.realmURL}_config`, {
method: 'PATCH',
headers,
body: JSON.stringify({
data: {
type: 'realm-config',
id: this.url,
attributes: { [property]: value },
},
}),
});

if (response.status !== 200) {
throw new Error(
`Failed to set realm config property '${property}' for realm ${this.url}: ${response.status}`,
);
}
let json = await waitForPromise(response.json());
let isPublic = Boolean(
response.headers.get('x-boxel-realm-public-readable'),
);
let updatedInfo = new TrackedObject({
url: json.data.id,
...json.data.attributes,
isIndexing: this.info?.isIndexing ?? false,
isPublic,
}) as EnhancedRealmInfo;
this.info = updatedInfo;
}

async fetchRealmPermissions() {
return await this.fetchRealmPermissionsTask.perform();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/realm-server/handlers/create-realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export async function createRealm(

// publishable lives in realm_metadata. A fresh realm has no
// hostRoutingRules to seed (host mode picks them up from the
// realm.json card once an operator sets one via /_config). Reset
// realm.json card once an operator edits one). Reset
// all mutable metadata columns on conflict so a stale row (e.g.
// left over from a previous realm at the same URL whose delete
// didn't clean up) doesn't bleed into the new realm.
Expand Down
Loading
Loading