21 lines
401 B
JavaScript
21 lines
401 B
JavaScript
|
|
import http from './http'
|
||
|
|
|
||
|
|
// 백엔드 /api/users 엔드포인트와 매핑
|
||
|
|
export const userApi = {
|
||
|
|
list() {
|
||
|
|
return http.get('/users')
|
||
|
|
},
|
||
|
|
get(id) {
|
||
|
|
return http.get(`/users/${id}`)
|
||
|
|
},
|
||
|
|
create(payload) {
|
||
|
|
return http.post('/users', payload)
|
||
|
|
},
|
||
|
|
update(id, payload) {
|
||
|
|
return http.put(`/users/${id}`, payload)
|
||
|
|
},
|
||
|
|
remove(id) {
|
||
|
|
return http.delete(`/users/${id}`)
|
||
|
|
},
|
||
|
|
}
|