Navigation

    Vietnam

    Nodejs.vn

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Groups
    • Search
    1. Home
    2. Công Toàn Lê
    C
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Công Toàn Lê

    @Công Toàn Lê

    0
    Reputation
    2
    Posts
    164
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Công Toàn Lê Follow

    Best posts made by Công Toàn Lê

    This user hasn't posted anything yet.

    Latest posts made by Công Toàn Lê

    • RE: Lỗi respond data

      Cảm ơn các bạn. mình đã fix dc rồi nha

      posted in ReactJS
      C
      Công Toàn Lê
    • Lỗi respond data

      Mình viết hàm lấy API JSON dùng Promise (resolve, reject) mà cứ bị reject hoài không hiểu lý do tại sao. Anh em check lỗi giúp mình nha. Tạ ơn anh em nhiều lắm

      File JSON: {"id":3,"url":"http://localhost:8000/api/v1/feeds/3/?format=json","user":{"id":2,"username":"lecongtoan2","first_name":"Tran","last_name":"Haong"},"date":"2017-08-31T04:56:32.785000Z","post":"lecongtoan2 has joined the network.","likes":0,"comments":0,"comment_list":[]}

      getFeedDetail (id) {
      baseUrl: 'http://localhost:8000/api/v1/',
      return new Promise((resolve, reject) => {
      request.defaults.baseURL = this.baseUrl
      request.get(feeds/${id}/).then(response => {
      const data = [...response.data][0]
      if (response.status === 200 && response.data.length > 0) {
      const filtered = {
      post: data.post
      }
      resolve(filtered)
      } else {
      console.log('Failed')
      reject(response)
      }
      })
      })
      }
      }

      posted in ReactJS
      C
      Công Toàn Lê