Delete a published mod (admin-gated): removes its catalog entry and its artifact from the store. 204 on success, 404 if the mod doesn't exist, 401 without a valid admin key.
(
State(state): State<AppState>,
headers: HeaderMap,
Path(mod_id): Path<String>,
)
| 529 | |
| 530 | let name = name.filter(|value| !value.trim().is_empty()); |
| 531 | if name.is_none() || !file_seen { |
| 532 | // Clean up the temp upload, then report the missing field. |
| 533 | let _ = state |
| 534 | .service |
| 535 | .finalize_mod_upload(upload, ModUploadMeta::default()) |
| 536 | .await; |
| 537 | let missing = if name.is_none() { "name" } else { "file" }; |
| 538 | return Err(( |
| 539 | StatusCode::BAD_REQUEST, |
| 540 | format!("missing '{missing}' field"), |
| 541 | )); |
| 542 | } |
| 543 | |
| 544 | state |
| 545 | .service |
| 546 | .finalize_mod_upload( |
| 547 | upload, |
| 548 | ModUploadMeta { |
| 549 | name: name.unwrap(), |
| 550 | app_name: app_name.filter(|value| !value.trim().is_empty()), |
| 551 | actver: actver.and_then(|value| value.trim().parse().ok()), |
| 552 | version_tag: version_tag.filter(|value| !value.trim().is_empty()), |
| 553 | version: version.filter(|value| !value.trim().is_empty()), |
| 554 | folder_name: folder_name.filter(|value| !value.trim().is_empty()), |
| 555 | description: description.filter(|value| !value.is_empty()), |
| 556 | authors, |
nothing calls this directly
no test coverage detected