This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-03-06 16:42:19 +07:00
parent 4ac7528c5c
commit cfcf63b9aa
2 changed files with 3 additions and 48 deletions

View file

@ -32,9 +32,6 @@ import { viewRegistryOfficer } from "../entities/view/viewRegistryOfficer";
import { viewRegistryEmployee } from "../entities/view/viewRegistryEmployee";
import { EmployeeTempPosMaster } from "../entities/EmployeeTempPosMaster";
import { WebSocket } from "ws";
import { wss } from "../app"; // ✅ Import clients
@Route("api/v1/org/report")
@Tags("Report")
@Security("bearerAuth")
@ -3540,19 +3537,8 @@ export class ReportController extends Controller {
}
}
}
// ✅ ส่งข้อมูลไปยังทุกไคลเอนต์ที่เชื่อมต่อ WebSocket
wss.clients.forEach((client) => {
if (client.readyState === WebSocket.OPEN) {
if (client.readyState === 1) {
client.send(
JSON.stringify({ template: "report2", reportName: "report2", data: { data } }),
);
}
}
});
// return new HttpSuccess({ template: "report2", reportName: "report2", data: { data } });
return new HttpSuccess({ template: "report2", reportName: "report2", data: { data } });
}
/**