Skip to content

Commit

Permalink
chore: comment and cors changes
Browse files Browse the repository at this point in the history
  • Loading branch information
112batuhan committed Nov 16, 2024
1 parent e836a8d commit 4f929d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/handlers/activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use crate::{
schema_with, AppState,
};

/// `Activity` type
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
pub struct Activity {
id: String,
Expand Down
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ async fn main() {
aide::gen::extract_schemas(true);
let mut api = OpenApi::default();

let cors = CorsLayer::new().allow_methods(Any).allow_origin(Any);
let cors = CorsLayer::new()
.allow_methods(Any)
.allow_origin(Any)
.allow_methods(Any)
.allow_credentials(true);

let compression = CompressionLayer::new()
.gzip(true)
.deflate(true)
Expand Down
4 changes: 2 additions & 2 deletions src/schema_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use crate::{database::user::UserSmall, osu_api::OsuBeatmapSmall};
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
pub struct FlattenedActivityType {
pub event_type: EventType,
/// Influenced user. `UserSmall` object. For `ADD_INFLUENCE`, `REMOVE_INFLUENCE`,
/// Influenced user. `UserSmall` type. For `ADD_INFLUENCE`, `REMOVE_INFLUENCE`,
/// `ADD_INFLUENCE_BEATMAP`, `REMOVE_INFLUENCE_BEATMAP`, `EDIT_INFLUENCE_DESC`,
/// `EDIT_INFLUENCE_TYPE` activity types.
pub influence: Option<UserSmall>,
/// Added or removed beatmap. `OsuBeatmapSmall` object. For `ADD_USER_BEATMAP`, `REMOVE_USER_BEATMAP`,
/// Added or removed beatmap. `OsuBeatmapSmall` type. For `ADD_USER_BEATMAP`, `REMOVE_USER_BEATMAP`,
/// `ADD_INFLUENCE_BEATMAP`, `REMOVE_INFLUENCE_BEATMAP` activity types.
pub beatmap: Option<OsuBeatmapSmall>,
/// Changed influence description. for `EDIT_INFLUENCE_DESC` activity type.
Expand Down

0 comments on commit 4f929d0

Please sign in to comment.