Browse Source

Merge branch 'master' of http://git.ycjcjy.com/marketing/pc-admin into master

zlisen 3 years ago
parent
commit
80eba08f30
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/pages/news/list/List.jsx

+ 3
- 3
src/pages/news/list/List.jsx View File

18
   const [loading, setLoading] = useState(false);
18
   const [loading, setLoading] = useState(false);
19
   const [page, setPage] = useState({ current: 1, pageSize: 10 });
19
   const [page, setPage] = useState({ current: 1, pageSize: 10 });
20
   const onPublish = useCallback(row => {
20
   const onPublish = useCallback(row => {
21
-    const buidingStatus = row.status === 1 ? 2 : 1;
22
-    request({ ...apis.building.updateStatus, data: { id: row.buildingId, status: buidingStatus } })
21
+    const newsStatus = row.newsStatus === 1 ? 0 : 1;
22
+    request({ ...apis.news.put, urlData: { id: row.newsId }, data: { ...row, newsStatus } })
23
       .then(() => {
23
       .then(() => {
24
         notification.success({ message: '操作成功' });
24
         notification.success({ message: '操作成功' });
25
         setLoading(false);
25
         setLoading(false);
43
 
43
 
44
   const onDelete = useCallback(row => {
44
   const onDelete = useCallback(row => {
45
     setLoading(true);
45
     setLoading(true);
46
-    request({ ...apis.building.deleteBuilding, urlData: { id: row.buildingId } })
46
+    request({ ...apis.news.delete, urlData: { id: row.newsId } })
47
       .then(() => {
47
       .then(() => {
48
         notification.success({ message: '操作成功' });
48
         notification.success({ message: '操作成功' });
49
         setLoading(false);
49
         setLoading(false);