def delete_product(cust_id, wishlist_id, pid): # """ delete product ID to a wishlist """ """ Delete a product from a Wishlist This endpoint will delete a product from a wishlist based on the customer ID, Wishlist ID, an product ID specified in the path --- tags: - Wishlists parameters: - name: cust_id in: path description: ID of customer who wants to delete a product from his/her wishlist required: true type: integer - name: wishlist_id in: path description: ID of wishlist to be updated required: true type: integer - name: pid in: path description: ID of product to be deleted required: true type: integer responses: 200: description: Product deleted from a wishlist schema: id: Wishlist properties: Customer ID: type: integer description: ID of customer Wishlist: type: object properties: wishlist name: type: string description: the Wishlists's name Product list: type: array items: type: string description: the list of products in a Wishlist 404: description: Not Found (either customer ID or wishlist ID is not valid, no record found) """ # TODO add products changes as well, for now just asses the wishlists if Customer.check_custid(cust_id): message = Customer.find_by_id(cust_id, wishlist_id) if message: result = Customer.deleteProduct(cust_id, wishlist_id, pid) res = Customer.find_by_id(cust_id, wishlist_id) return make_response(jsonify(res), status.HTTP_200_OK) else: message = {'Error': 'Wishlist with given ID not found'} return make_response(jsonify(message), status.HTTP_404_NOT_FOUND) else: message = {'Invalid': 'Invalid customer ID'} return make_response(jsonify(message), status.HTTP_404_NOT_FOUND)