mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-19 19:36:38 +00:00
Consolidate the messages into the same enum
This commit is contained in:
@@ -22,6 +22,7 @@ import { sendToClient } from "#dynamic/routers/ws";
|
||||
import { deletePeer } from "../gerbil/peers";
|
||||
import { OpenAPITags, registry } from "@server/openApi";
|
||||
import { OlmErrorCodes } from "../olm/error";
|
||||
import { sendTerminateClient } from "../client/terminate";
|
||||
|
||||
const deleteOrgSchema = z.strictObject({
|
||||
orgId: z.string()
|
||||
@@ -207,13 +208,11 @@ export async function deleteOrg(
|
||||
}
|
||||
|
||||
for (const olmId of olmsToTerminate) {
|
||||
sendToClient(olmId, {
|
||||
type: "olm/terminate",
|
||||
data: {
|
||||
code: OlmErrorCodes.TERMINATED_REKEYED,
|
||||
message: "Organization has been deleted"
|
||||
}
|
||||
}).catch((error) => {
|
||||
sendTerminateClient(
|
||||
0, // clientId not needed since we're passing olmId
|
||||
OlmErrorCodes.TERMINATED_REKEYED,
|
||||
olmId
|
||||
).catch((error) => {
|
||||
logger.error(
|
||||
"Failed to send termination message to olm:",
|
||||
error
|
||||
|
||||
Reference in New Issue
Block a user