|
@@ -125,9 +125,13 @@ export const submitContactForm = async (formData: FormData) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export const submitOrderReview = async (orderId: number, data: { rating: number, review_text: string }) => {
|
|
export const submitOrderReview = async (orderId: number, data: { rating: number, review_text: string }) => {
|
|
|
|
|
+ const token = localStorage.getItem("token");
|
|
|
const response = await fetch(`${API_BASE_URL}/orders/${orderId}/review?lang=${i18n.global.locale.value}`, {
|
|
const response = await fetch(`${API_BASE_URL}/orders/${orderId}/review?lang=${i18n.global.locale.value}`, {
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- headers: { 'Content-Type': 'application/json' },
|
|
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ 'Content-Type': 'application/json',
|
|
|
|
|
+ 'Authorization': `Bearer ${token}`
|
|
|
|
|
+ },
|
|
|
body: JSON.stringify(data),
|
|
body: JSON.stringify(data),
|
|
|
});
|
|
});
|
|
|
|
|
|