tangled
alpha
login
or
join now
eldridge.cam
/
cartography
0
fork
atom
Trading card city builder game?
0
fork
atom
overview
issues
pulls
pipelines
fixing AccountIdOrMe type
eldridge.cam
1 month ago
a8cd5021
f781e71e
verified
This commit was signed with the committer's
known signature
.
eldridge.cam
SSH Key Fingerprint:
SHA256:MAgO4sya2MgvdgUjSGKAO0lQ9X2HQp1Jb+x/Tpeeims=
+8
-2
3 changed files
expand all
collapse all
unified
split
src
api
operations
list_fields.rs
dto
mod.rs
main.rs
+1
src/api/operations/list_fields.rs
···
25
25
db: axum::Extension<sqlx::PgPool>,
26
26
Path(player_id): Path<AccountIdOrMe>,
27
27
) -> axum::response::Result<Json<ListFieldsResponse>> {
28
28
+
dbg!(&player_id);
28
29
let AccountIdOrMe::AccountId(account_id) = player_id else {
29
30
respond_internal_server_error!("unimplemented");
30
31
};
+2
-2
src/dto/mod.rs
···
3
3
use time::OffsetDateTime;
4
4
use utoipa::ToSchema;
5
5
6
6
-
#[derive(Serialize, Deserialize, ToSchema)]
7
7
-
#[serde(untagged)]
6
6
+
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize, ToSchema)]
8
7
pub enum AccountIdOrMe {
9
8
#[serde(rename = "@me")]
10
9
Me,
10
10
+
#[serde(untagged)]
11
11
AccountId(String),
12
12
}
13
13
+5
src/main.rs
···
20
20
21
21
api::operations::list_fields,
22
22
),
23
23
+
components(
24
24
+
schemas(
25
25
+
crate::dto::AccountIdOrMe
26
26
+
)
27
27
+
),
23
28
tags(
24
29
(name = "Global", description = "Publicly available global data about the Cartography game."),
25
30
(name = "Player", description = "Player specific data; typically requires authorization."),