mirror of
https://github.com/StepanovPlaton/torrent_frontend.git
synced 2026-04-03 12:20:48 +04:00
17 lines
601 B
TypeScript
17 lines
601 B
TypeScript
import { HTTPService } from "@/shared/utils/http";
|
|
import { gameCardsSchema, GameCardType } from "./schemas/gameCard";
|
|
import { GameCreateType, gameSchema } from "./schemas/game";
|
|
import { z } from "zod";
|
|
|
|
export abstract class GameService {
|
|
public static async getGameCards() {
|
|
return await HTTPService.get("/games/cards", gameCardsSchema);
|
|
}
|
|
public static async getGame(id: number) {
|
|
return await HTTPService.get(`/games/${id}`, gameSchema);
|
|
}
|
|
public static async changeGame(id: number, gameInfo: GameCreateType) {
|
|
return await HTTPService.put(`/games/${id}`, gameSchema, gameInfo);
|
|
}
|
|
}
|