This commit is contained in:
Aleksandr 2025-12-14 23:29:36 +03:00
parent 360675f6f9
commit a320b99aa3
10 changed files with 79 additions and 44 deletions

View file

@ -57,6 +57,8 @@ impl Games for HttpClient {
slug,
vndb,
release_date,
tags,
genres,
}| {
(
"/games".into(),
@ -65,6 +67,8 @@ impl Games for HttpClient {
description,
thumbnail,
author,
tags,
genres,
slug,
vndb,
release_date,

View file

@ -5,7 +5,7 @@ use crate::requests::status_code;
use viendesu_core::{
errors,
requests::games as reqs,
types::{Patch, author, file, game},
types::{Patch, author, file, game, mark},
};
#[data]
@ -15,9 +15,9 @@ pub struct Update {
pub description: Patch<Option<game::Description>>,
pub slug: Patch<game::Slug>,
pub thumbnail: Patch<Option<file::Id>>,
pub genres: Patch<game::Genres>,
pub badges: Patch<game::Badges>,
pub tags: Patch<game::Tags>,
pub genres: Patch<mark::Genres>,
pub badges: Patch<mark::Badges>,
pub tags: Patch<mark::Tags>,
pub screenshots: Patch<game::Screenshots>,
pub published: Patch<bool>,
}
@ -62,6 +62,10 @@ pub struct Create {
pub thumbnail: Option<file::Id>,
pub author: author::Id,
pub slug: Option<game::Slug>,
#[serde(default)]
pub tags: mark::Tags,
#[serde(default)]
pub genres: mark::Genres,
pub vndb: Option<game::VndbId>,
pub release_date: Option<game::ReleaseDate>,
}

View file

@ -350,6 +350,8 @@ fn games<T: Types>(router: RouterScope<T>) -> RouterScope<T> {
title,
description,
thumbnail,
tags,
genres,
author,
slug,
vndb,
@ -364,6 +366,8 @@ fn games<T: Types>(router: RouterScope<T>) -> RouterScope<T> {
thumbnail,
author,
slug,
tags,
genres,
vndb,
release_date,
})