mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-03 08:00:32 +00:00
invalidate subdomains on delete
This commit is contained in:
@@ -213,6 +213,17 @@ export class SubdomainDriver extends PuterDriver {
|
||||
const [shaped] = await this.#hydrateRows(
|
||||
updated ? [updated as Record<string, unknown>] : [],
|
||||
);
|
||||
|
||||
try {
|
||||
this.clients.event.emit(
|
||||
'subdomain.update',
|
||||
{ subdomain: row.subdomain as string },
|
||||
{},
|
||||
);
|
||||
} catch {
|
||||
// Non-critical.
|
||||
}
|
||||
|
||||
return shaped ?? null;
|
||||
}
|
||||
|
||||
@@ -299,6 +310,17 @@ export class SubdomainDriver extends PuterDriver {
|
||||
await this.stores.subdomain.deleteByUuid(row.uuid, {
|
||||
userId: row.user_id,
|
||||
});
|
||||
|
||||
try {
|
||||
this.clients.event.emit(
|
||||
'subdomain.delete',
|
||||
{ subdomain: row.subdomain as string },
|
||||
{},
|
||||
);
|
||||
} catch {
|
||||
// Non-critical.
|
||||
}
|
||||
|
||||
return { success: true, uid: row.uuid };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user