mirror of
https://github.com/StepanovPlaton/torrent_frontend.git
synced 2026-04-04 04:40:50 +04:00
Add genres and actors
This commit is contained in:
@@ -10,6 +10,12 @@ import {
|
||||
TypesOfItems,
|
||||
} from "../types";
|
||||
import { ItemService } from "../item";
|
||||
import {
|
||||
GameGenreCreateType,
|
||||
gameGenreSchema,
|
||||
gameGenresSchema,
|
||||
} from "./schemas/genre";
|
||||
import { RequiredFrom } from "@/shared/utils/types";
|
||||
|
||||
@staticImplements<IItemService>()
|
||||
export abstract class GameService {
|
||||
@@ -26,7 +32,7 @@ export abstract class GameService {
|
||||
|
||||
public static async GetCards() {
|
||||
return await HTTPService.get(
|
||||
`/${this.urlPrefix}/cards`,
|
||||
`/${this.urlPrefix}`,
|
||||
gameCardsSchema,
|
||||
this.cacheOptions(`/${this.urlPrefix}/cards`)
|
||||
);
|
||||
@@ -49,7 +55,7 @@ export abstract class GameService {
|
||||
});
|
||||
}
|
||||
|
||||
public static GetEmpty(): GameCreateType {
|
||||
public static GetEmpty(): RequiredFrom<GameCreateType> {
|
||||
return {
|
||||
title: "",
|
||||
torrent_file: "",
|
||||
@@ -57,6 +63,20 @@ export abstract class GameService {
|
||||
};
|
||||
}
|
||||
|
||||
public static async GetGenres() {
|
||||
return await HTTPService.get(`/genres/${this.urlPrefix}`, gameGenresSchema);
|
||||
}
|
||||
|
||||
public static async CreateGenre(info: GameGenreCreateType) {
|
||||
return await HTTPService.post(
|
||||
`/genres/${this.urlPrefix}`,
|
||||
gameGenreSchema,
|
||||
{
|
||||
body: info,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
static propertiesDescription: ItemPropertiesDescriptionType<GameType> = [
|
||||
[
|
||||
{ name: "Система", key: "system" },
|
||||
|
||||
Reference in New Issue
Block a user