File size: 664 Bytes
36131f5
 
8552e78
36131f5
8552e78
 
36131f5
 
 
 
8552e78
36131f5
 
 
 
8552e78
36131f5
 
 
 
8552e78
36131f5
 
 
 
8552e78
36131f5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import axios from 'axios'

const BASE = 'http://127.0.0.1:8000'

export async function recommend(user_id, content_id) {
  const r = await axios.post(`${BASE}/recommend`, { user_id, content_id })
  return r.data
}

export async function feedback(impression_id, reward) {
  const r = await axios.post(`${BASE}/feedback`, { impression_id, reward })
  return r.data
}

export async function stats() {
  const r = await axios.get(`${BASE}/stats`)
  return r.data
}

export async function getUsers() {
  const r = await axios.get(`${BASE}/users`)
  return r.data
}

export async function getContents() {
  const r = await axios.get(`${BASE}/contents`)
  return r.data
}