JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Add parameters to RepositoryInfoRequest and derive Clone on setting types

Type: Feature

erremilia - ⁨2⁩ years ago

parent: tbd commit: ⁨fcde8d4

Showing ⁨⁨2⁩ changed files⁩ with ⁨⁨14⁩ insertions⁩ and ⁨⁨6⁩ deletions⁩

giterated-models/src/repository/operations.rs

View file
@@ -19,7 +19,11 @@ use super::{IssueLabel, Repository, RepositoryIssue, RepositoryTreeEntry, Reposi
19 19 /// - User Authorization
20 20 /// - Potential User permissions checks
21 21 #[derive(Clone, Debug, Serialize, Deserialize)]
22 pub struct RepositoryInfoRequest;
22 pub struct RepositoryInfoRequest {
23 pub extra_metadata: bool,
24 pub rev: Option<String>,
25 pub path: Option<String>,
26 }
23 27
24 28 impl GiteratedOperation<Repository> for RepositoryInfoRequest {
25 29 type Success = RepositoryView;
@@ -88,9 +92,13 @@ impl GiteratedOperation<Repository> for RepositoryFileInspectRequest {
88 92 }
89 93
90 94 impl<B: ObjectBackend + std::fmt::Debug> Object<'_, Repository, B> {
91 pub async fn info(&mut self) -> Result<RepositoryView, OperationError<RepositoryError>> {
92 self.request::<RepositoryInfoRequest>(RepositoryInfoRequest)
93 .await
95 pub async fn info(&mut self, extra_metadata: bool, rev: Option<String>, path: Option<String>) -> Result<RepositoryView, OperationError<RepositoryError>> {
96 self.request::<RepositoryInfoRequest>(RepositoryInfoRequest {
97 extra_metadata,
98 rev,
99 path,
100 })
101 .await
94 102 }
95 103 // pub async fn issues_count(&mut self) -> Result<u64, OperationError<RepositoryError>> {
96 104 // self.request::<RepositoryIssuesCountRequest>(RepositoryIssuesCountRequest)

giterated-models/src/user/settings.rs

View file
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
2 2
3 3 use crate::settings::Setting;
4 4
5 #[derive(Debug, Serialize, Deserialize)]
5 #[derive(Debug, Serialize, Deserialize, Clone)]
6 6 pub struct UserBio(pub String);
7 7
8 8 impl Setting for UserBio {
@@ -20,7 +20,7 @@ impl Setting for UserDisplayName {
20 20 }
21 21 }
22 22
23 #[derive(Debug, Serialize, Deserialize)]
23 #[derive(Debug, Serialize, Deserialize, Clone)]
24 24 pub struct UserDisplayImage(pub String);
25 25
26 26 impl Setting for UserDisplayImage {