feat: add puzzle clear template runtime
This commit is contained in:
@@ -72,6 +72,12 @@ pub async fn require_creation_entry_route_enabled(
|
||||
|
||||
pub fn resolve_creation_entry_route_id(path: &str) -> Option<&'static str> {
|
||||
let normalized = path.trim_end_matches('/');
|
||||
if normalized.starts_with("/api/runtime/puzzle-clear") {
|
||||
return Some("puzzle-clear");
|
||||
}
|
||||
if normalized.starts_with("/api/creation/puzzle-clear") {
|
||||
return Some("puzzle-clear");
|
||||
}
|
||||
if normalized.starts_with("/api/runtime/puzzle") {
|
||||
return Some("puzzle");
|
||||
}
|
||||
@@ -173,6 +179,14 @@ mod tests {
|
||||
resolve_creation_entry_route_id("/api/runtime/puzzle/works"),
|
||||
Some("puzzle"),
|
||||
);
|
||||
assert_eq!(
|
||||
resolve_creation_entry_route_id("/api/creation/puzzle-clear/sessions"),
|
||||
Some("puzzle-clear"),
|
||||
);
|
||||
assert_eq!(
|
||||
resolve_creation_entry_route_id("/api/runtime/puzzle-clear/runs/run-1"),
|
||||
Some("puzzle-clear"),
|
||||
);
|
||||
assert_eq!(
|
||||
resolve_creation_entry_route_id("/api/runtime/match3d/runs/run-1"),
|
||||
Some("match3d"),
|
||||
|
||||
Reference in New Issue
Block a user