-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Below code worked:
#[route("/home", method = post)]
pub async fn createHome(
state: StateRef<'_, AppState>,
body: LazyJson<HomeCU<'_>>,
) -> Result<Json<home::Model>, Error> {
//...
}
#[route("/home/getHomes", method = get)]
pub async fn getHomes(state: StateRef<'_, AppState>) -> Result<Json<Vec<home::Model>>, Error> {
//...
}But if the code is like this, the program will panic:
#[route("/home", method = post)]
pub async fn createHome(
state: StateRef<'_, AppState>,
body: LazyJson<HomeCU<'_>>,
) -> Result<Json<home::Model>, Error> {
//...
}
#[route("/home", method = get)] //<-- This line changed
pub async fn getHomes(state: StateRef<'_, AppState>) -> Result<Json<Vec<home::Model>>, Error> {
//...
}Can you please make it no panic?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels