import define from "../../define.js";
import { cancelMatch } from "@/services/reversi/index.js";

export const meta = {
	tags: ["reversi"],
	requireCredential: true,
	kind: "write:account",
} as const;

export const paramDef = {
	type: "object",
	properties: {
		userId: { type: "string", format: "misskey:id", nullable: true },
	},
	required: [],
} as const;

export default define(meta, paramDef, async (ps, user) => {
	await cancelMatch(user, ps.userId);
});
