Skip to content

Commit

Permalink
Fix PUT requests (#151)
Browse files Browse the repository at this point in the history
The API doesn't expect PUT requests to include the entity ID in the
URL, since the ID is already contained in the JSON body.
  • Loading branch information
senekor authored Dec 28, 2023
1 parent e5705a2 commit af1b1ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/state/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub async fn process(action: PreMiddlewareAction) -> Action {
}

async fn submit<T: Entity>(entity: T, token: &Token) -> T {
RequestBuilder::new(&Url::new().id(entity.get_id()).build())
RequestBuilder::new(&Url::<T>::new().build())
.with_token(token)
.post_or_put_by(entity.get_id())
.json(&entity)
Expand Down

0 comments on commit af1b1ca

Please sign in to comment.