Kaynağa Gözat

Merge branch 'Alyosha' into dev

vit9 6 yıl önce
ebeveyn
işleme
f16f77eeb4
3 değiştirilmiş dosya ile 2781 ekleme ve 736 silme
  1. 2729 734
      package-lock.json
  2. 2 1
      package.json
  3. 50 1
      src/components/Header/searchLine.js

Dosya farkı çok büyük olduğundan ihmal edildi
+ 2729 - 734
package-lock.json


+ 2 - 1
package.json

@@ -4,10 +4,11 @@
   "private": true,
   "dependencies": {
     "antd": "^3.11.2",
+    "axios": "^0.18.0",
     "react": "^16.6.3",
     "react-dom": "^16.6.3",
     "react-router-dom": "^4.3.1",
-    "react-scripts": "2.1.1"
+    "react-scripts": "^2.1.3"
   },
   "scripts": {
     "start": "react-scripts start",

+ 50 - 1
src/components/Header/searchLine.js

@@ -1,7 +1,56 @@
 import React, { Component } from 'react';
 import { Input } from 'antd';
-
 const Search = Input.Search;
+const axios = require('axios');
+
+//Выводит всех пользователей
+// axios.get('http://127.0.0.1:2000/api/users')
+//   .then(function (response) {
+//     // handle success
+//     console.log(response.data);
+//   })
+
+//Добавить пользователя
+// axios.post(`http://127.0.0.1:2000/api/users`,{
+//         "name": "John",
+//         "description": "dfgfdhd",
+//         "login": "Johny",
+//         "password": "1234567",
+//         "isAdmin": "1",
+//         "email": "dsgdsgdf@gmail.com",
+//         "avatar": "",
+//         "phone": "+380951242245"  
+// })
+//   .then(function (response) {
+//     // handle success
+//     console.log(response);
+//   })
+
+//Обновление информации пользователя
+// axios.put(`http://127.0.0.1:2000/api/users`,{
+//     "id": "151",
+//         "name": "Joh124",
+//         "description": "dfgfdhd",
+//         "login": "Johny",
+//         "password": "1234567",
+//         "isAdmin": "1",
+//         "email": "dsgdsgdf@gmail.com",
+//         "avatar": "",
+//         "phone": "+380951242245"  
+// })
+//   .then(function (response) {
+//     // handle success
+//     console.log(response);
+//   })
+
+// axios.delete(`http://127.0.0.1:2000/api/users`, {
+//     "id": "151"
+// })
+//   .then(function (response) {
+//     // handle success
+//     console.log(response);
+//   })
+
 
 class SearchLine extends Component {
     render() {