KI-AGENT: Matrix-Räume in FEDEO provisionieren
This commit is contained in:
@@ -49,4 +49,29 @@ export default async function communicationRoutes(server: FastifyInstance) {
|
||||
.send({ error: err.message || "Matrix tenant space provisioning failed" })
|
||||
}
|
||||
})
|
||||
|
||||
server.get("/communication/matrix/rooms/general", async (req, reply) => {
|
||||
try {
|
||||
return await matrix.getTenantRoomStatus(req.user.tenant_id, "allgemein", "Allgemeiner Chat")
|
||||
} catch (err: any) {
|
||||
req.log.error(err)
|
||||
return reply
|
||||
.code(err.statusCode || 500)
|
||||
.send({ error: err.message || "Matrix room status failed" })
|
||||
}
|
||||
})
|
||||
|
||||
server.post("/communication/matrix/rooms/general/provision", async (req, reply) => {
|
||||
try {
|
||||
return await matrix.provisionTenantRoom(req.user.user_id, req.user.tenant_id, {
|
||||
key: "allgemein",
|
||||
name: "Allgemeiner Chat",
|
||||
})
|
||||
} catch (err: any) {
|
||||
req.log.error(err)
|
||||
return reply
|
||||
.code(err.statusCode || 500)
|
||||
.send({ error: err.message || "Matrix room provisioning failed" })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user