GuessWhoIAmS/src/api/room/ApiChangeState.ts
2023-09-11 15:27:45 +08:00

12 lines
505 B
TypeScript

import { ApiCall, BaseConnection } from "tsrpc";
import Room from "../../component/Room/Room";
import { ReqChangeState, ResChangeState } from "../../shared/protocols/room/PtlChangeState";
import { ServiceType } from "../../shared/protocols/serviceProto";
export default async function (call: ApiCall<ReqChangeState, ResChangeState>) {
call.succ(0);
const { state } = call.req;
const conn: BaseConnection<ServiceType> = call.conn;
const room: Room = conn.Room;
room.ChangeState(false, state, conn);
}