This commit is contained in:
Rizky 2023-10-18 06:04:35 +00:00
parent 4afbf111de
commit 2f4d747f33
1 changed files with 3 additions and 1 deletions

View File

@ -9,13 +9,15 @@ import {
WS_MSG_SET_COMP, WS_MSG_SET_COMP,
WS_MSG_SV_LOCAL, WS_MSG_SV_LOCAL,
} from "../../../../web/src/utils/types/ws"; } from "../../../../web/src/utils/types/ws";
import { validate } from "uuid";
export const getComp = async ( export const getComp = async (
ws: ServerWebSocket<WSData>, ws: ServerWebSocket<WSData>,
msg: WS_MSG_GET_COMP msg: WS_MSG_GET_COMP
) => { ) => {
const comp_id = msg.comp_id; const comp_id = msg.comp_id;
if (!validate(comp_id)) return;
if (!eg.edit.comp[comp_id]) { if (!eg.edit.comp[comp_id]) {
const rawComp = await db.component.findFirst({ const rawComp = await db.component.findFirst({
where: { where: {