修复查看帖子、评论、回复评论、点赞、收藏,添加用户等级
Change-Id: Ida9590d7ccee08dcd787a36c7e5cb39a3e26cd0d
diff --git a/src/pages/PromotionsPage/PromotionsPage.jsx b/src/pages/PromotionsPage/PromotionsPage.jsx
index bb50d72..834ad73 100644
--- a/src/pages/PromotionsPage/PromotionsPage.jsx
+++ b/src/pages/PromotionsPage/PromotionsPage.jsx
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import './PromotionsPage.css';
-const API_BASE = process.env.REACT_APP_API_BASE;
+
function PromotionsPage() {
const [promotions, setPromotions] = useState([]);
const [currentPromotion, setCurrentPromotion] = useState(null);
@@ -33,7 +33,7 @@
const fetchPromotions = async (page = 1) => {
setIsLoading(true);
try {
- const response = await fetch(`${API_BASE}/promotions/list?page=${page}&per_page=${perPage}`, {
+ const response = await fetch(`/promotions/list?page=${page}&per_page=${perPage}`, {
headers: getAuthHeaders()
});
@@ -59,7 +59,7 @@
const fetchPromotionDetails = async (promoId) => {
setIsLoading(true);
try {
- const response = await fetch(`${API_BASE}/promotions/${promoId}`, {
+ const response = await fetch(`/promotions/${promoId}`, {
headers: getAuthHeaders()
});
@@ -94,7 +94,7 @@
setIsLoading(true);
try {
- const response = await fetch('${API_BASE}/promotions/add', {
+ const response = await fetch('/promotions/add', {
method: 'POST',
headers: getAuthHeaders(),
body: JSON.stringify(formData)
@@ -136,7 +136,7 @@
setIsLoading(true);
try {
- const response = await fetch(`${API_BASE}/promotions/delete/${promoId}`, {
+ const response = await fetch(`/promotions/delete/${promoId}`, {
method: 'DELETE',
headers: getAuthHeaders()
});