Modificacion en api de lista

This commit is contained in:
Daniel Cortes
2020-07-14 15:05:33 -04:00
parent a25a985263
commit ec0a2c807f
2 changed files with 5 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ const AddForm = (props) => {
const handleSave = () => { const handleSave = () => {
add_to_list(context.user.access_token, JSON.parse(window.localStorage.getItem('user')).id, add_to_list(context.user.access_token, JSON.parse(window.localStorage.getItem('user')).id,
props.entity, props.type, []).then(() => { props.entity, props.type, [], opinion, stars).then(() => {
setState(1); setState(1);
}).catch((error) => { }).catch((error) => {
console.log('Request error', error.response) console.log('Request error', error.response)

View File

@@ -6,11 +6,13 @@ export function get_list(user_id) {
return axios.get(`${baseUrl}/list/${user_id}/`) return axios.get(`${baseUrl}/list/${user_id}/`)
} }
export function add_to_list(token, user_id, entity, entity_type, tags) { export function add_to_list(token, user_id, entity, entity_type, tags, opinion, stars) {
const post_data = { const post_data = {
entity: entity, entity: entity,
entity_type: entity_type, entity_type: entity_type,
tags: tags tags: tags,
opinion: opinion,
stars: stars,
}; };
return axios.post(`${baseUrl}/list/${user_id}/`, post_data, { return axios.post(`${baseUrl}/list/${user_id}/`, post_data, {