Skip to content

Commit

Permalink
fix: fix legacy bolt get (#1193)
Browse files Browse the repository at this point in the history
<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
MasterPtato committed Oct 1, 2024
1 parent c265a37 commit 68285cb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion svc/pkg/build/ops/get/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ async fn handle(ctx: OperationContext<build::get::Request>) -> GlobalResult<buil
.await?
.into_iter()
.map(|build| {
let Value::Object(tags) = build.tags else {
bail!("tags not a map");
};

Ok(backend::build::Build {
build_id: Some(build.build_id.into()),
game_id: build.game_id.map(|x| x.into()),
Expand All @@ -60,7 +64,11 @@ async fn handle(ctx: OperationContext<build::get::Request>) -> GlobalResult<buil
create_ts: build.create_ts,
kind: build.kind as i32,
compression: build.compression as i32,
tags: serde_json::from_value(build.tags)?,
tags: serde_json::from_value(
tags.into_iter()
.filter(|(_, v)| !matches!(v, Value::Null))
.collect(),
)?,
})
})
.collect::<GlobalResult<Vec<_>>>()?;
Expand Down

0 comments on commit 68285cb

Please sign in to comment.