fix: item history page now live updates
This commit is contained in:
@@ -25,16 +25,15 @@ export const CreateItem = async (query: CreateItemQuery): Promise<ItemPriceRespo
|
||||
return res.data
|
||||
}
|
||||
|
||||
export const SetItemPrice = async (query: SetItemPriceQuery) => {
|
||||
export const SetItemPrice = async (query: SetItemPriceQuery): Promise<ItemPriceResponse> => {
|
||||
const queryParams = new URLSearchParams({
|
||||
item_id: query.item_id,
|
||||
item_price: query.item_price
|
||||
})
|
||||
|
||||
const res = await axios.put(process.env.NEXT_PUBLIC_API_URL + `/item/price?${queryParams.toString()}`, {}, {withCredentials: true})
|
||||
if (res.data.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
|
||||
return res.data as ItemPriceResponse
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user