mirror of
https://github.com/StepanovPlaton/torrent_frontend.git
synced 2026-04-03 20:30:48 +04:00
Work on game edit
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import { HTTPService } from "@/shared/utils/http";
|
||||
import { gameCardsSchema, GameCardType } from "./schemas/gameCard";
|
||||
import { gameSchema, GameType } from "./schemas/game";
|
||||
import { GameCreateType, gameSchema } from "./schemas/game";
|
||||
import { z } from "zod";
|
||||
|
||||
export abstract class GameService {
|
||||
public static async getGameCards() {
|
||||
return await HTTPService.get<GameCardType[]>(
|
||||
"/games/cards",
|
||||
gameCardsSchema
|
||||
);
|
||||
return await HTTPService.get("/games/cards", gameCardsSchema);
|
||||
}
|
||||
public static async getGame(id: number) {
|
||||
return await HTTPService.get<GameType>(`/games/${id}`, gameSchema);
|
||||
return await HTTPService.get(`/games/${id}`, gameSchema);
|
||||
}
|
||||
public static async changeGame(id: number, gameInfo: GameCreateType) {
|
||||
return await HTTPService.put(`/games/${id}`, gameSchema, gameInfo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user