GuessWhoIAmS/src/api/room/ApiChangeState.ts

12 lines
498 B
TypeScript
Raw Normal View History

2023-09-10 19:33:19 +08:00
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>) {
const { state } = call.req;
const conn: BaseConnection<ServiceType> = call.conn;
const room: Room = conn.Room;
room.ChangeState(conn, state);
call.succ(0);
}