refactor: modularize api server assets and handlers
This commit is contained in:
@@ -17,15 +17,14 @@ use module_puzzle::{
|
||||
PuzzleRunNextLevelInput, PuzzleRunPauseInput, PuzzleRunProcedureResult, PuzzleRunPropInput,
|
||||
PuzzleRunSnapshot, PuzzleRunStartInput, PuzzleRunSwapInput, PuzzleRuntimeLevelStatus,
|
||||
PuzzleSelectCoverImageInput, PuzzleUiBackgroundSaveInput, PuzzleWorkDeleteInput,
|
||||
PuzzleWorkGetInput,
|
||||
PuzzleWorkLikeRecordInput as PuzzleWorkLikeInput, PuzzleWorkPointIncentiveClaimInput,
|
||||
PuzzleWorkProcedureResult, PuzzleWorkProfile, PuzzleWorkRemixInput, PuzzleWorkUpsertInput,
|
||||
PuzzleWorksListInput, PuzzleWorksProcedureResult, apply_publish_overrides_to_draft,
|
||||
apply_selected_candidate, build_form_draft_from_seed, build_result_preview,
|
||||
compile_result_draft_from_seed, create_work_profile, infer_anchor_pack, normalize_puzzle_draft,
|
||||
normalize_puzzle_levels, normalize_theme_tags, publish_work_profile, replace_puzzle_level,
|
||||
select_next_profiles, selected_profile_level_after_runtime_level, selected_puzzle_level,
|
||||
tag_similarity_score,
|
||||
PuzzleWorkGetInput, PuzzleWorkLikeRecordInput as PuzzleWorkLikeInput,
|
||||
PuzzleWorkPointIncentiveClaimInput, PuzzleWorkProcedureResult, PuzzleWorkProfile,
|
||||
PuzzleWorkRemixInput, PuzzleWorkUpsertInput, PuzzleWorksListInput, PuzzleWorksProcedureResult,
|
||||
apply_publish_overrides_to_draft, apply_selected_candidate, build_form_draft_from_seed,
|
||||
build_result_preview, compile_result_draft_from_seed, create_work_profile, infer_anchor_pack,
|
||||
normalize_puzzle_draft, normalize_puzzle_levels, normalize_theme_tags, publish_work_profile,
|
||||
replace_puzzle_level, select_next_profiles, selected_profile_level_after_runtime_level,
|
||||
selected_puzzle_level, tag_similarity_score,
|
||||
};
|
||||
use module_runtime::RuntimeProfileWalletLedgerSourceType;
|
||||
use module_runtime::visible_runtime_profile_user_tags;
|
||||
@@ -1062,12 +1061,10 @@ fn save_puzzle_ui_background_tx(
|
||||
let mut next_level = target_level;
|
||||
next_level.ui_background_prompt = Some(input.prompt.trim().to_string());
|
||||
next_level.ui_background_image_src = Some(input.image_src.trim().to_string());
|
||||
next_level.ui_background_image_object_key = input
|
||||
.image_object_key
|
||||
.and_then(|value| {
|
||||
let trimmed = value.trim().to_string();
|
||||
(!trimmed.is_empty()).then_some(trimmed)
|
||||
});
|
||||
next_level.ui_background_image_object_key = input.image_object_key.and_then(|value| {
|
||||
let trimmed = value.trim().to_string();
|
||||
(!trimmed.is_empty()).then_some(trimmed)
|
||||
});
|
||||
let draft = replace_puzzle_level(&draft, next_level).map_err(|error| error.to_string())?;
|
||||
|
||||
let saved_at = Timestamp::from_micros_since_unix_epoch(input.saved_at_micros);
|
||||
|
||||
Reference in New Issue
Block a user