I am trying to make a put request on the url http://[::1]:3000/carts?filter[where][user_id]=5&filter[where][cart_id]=52 with two parameters respectively 'user_id' and 'user_id'. This is what I have tried .
@put('/carts?filter[where][user_id]={u_id}&filter[where][cart_id]={id}', {
responses: {
'204': {
description: 'Cart PUT success',
},
},
})
async replaceById2(
@param.path.number('u_id') u_id: number,
@param.path.number('id') id: number,
@requestBody() cart: Cart,
): Promise<void> {
await this.cartRepository.replaceById(id, cart);
}
I am passing two parameters from frontend to update data respectively 'user_id' and 'cart_id'.
updatecartItem (user_id,id,cart): Observable<any> {
return this.http.put(this.cart_url + 'carts?filter[where][user_id]=' + user_id +'&filter[where][cart_id]=' + id, cart, {observe : 'response'})
}
But I am getting 404 error as follows
statusCode: 404 name: "NotFoundError" message: "Endpoint "PUT /carts" not found."
Can you please direct me in creating custom put request with more than one parameters