Эксперимент 1
Использовать дочернюю таблицу для получения записей из первичных
This commit is contained in:
1 parent
785f9f0ba8
commit
c95853db46
5 files changed
+37
-27
No files matched your search
@@ -104,7 +104,7 @@ export default {
|
||||
.then(data => {
|
||||
t_baseCriteria.value = data.data.results
|
||||
})
|
||||
console.log(t_baseCriteria.value, 't_baseCriteria.value');
|
||||
|
||||
}
|
||||
|
||||
function f_userComment() {
|
||||
@@ -112,14 +112,14 @@ export default {
|
||||
.then(data => {
|
||||
t_userComment.value = data.data.results
|
||||
})
|
||||
console.log(t_userComment.value, 't_userComment.value');
|
||||
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
f_baseCriteria()
|
||||
f_userComment()
|
||||
|
||||
|
||||
})
|
||||
|
||||
function feedAll() {
|
||||
@@ -173,17 +173,18 @@ export default {
|
||||
}
|
||||
|
||||
function proba() {
|
||||
console.log(ratingStatus.value.decFeed, 'ratingStatus.value.decFeed');
|
||||
const feedObj = {}
|
||||
console.log(t_userComment.value, 't_userComment.value');
|
||||
// console.log(ratingStatus.value.decFeed, 'ratingStatus.value.decFeed');
|
||||
// const feedObj = {}
|
||||
|
||||
feedObj.comment = comment.value
|
||||
feedObj.ratingstatus = ratingStatus.value.decFeed
|
||||
if (t_userComment.value.length==0) {
|
||||
axiosApiInstance.post(`api/feedback/userComment/`, feedObj)
|
||||
}
|
||||
else {
|
||||
axiosApiInstance.put(`api/feedback/userCommentUp/${t_userComment.value[0].id}/`, feedObj)
|
||||
}
|
||||
// feedObj.comment = comment.value
|
||||
// feedObj.ratingstatus = ratingStatus.value.decFeed
|
||||
// if (t_userComment.value.length==0) {
|
||||
// axiosApiInstance.post(`api/feedback/userComment/`, feedObj)
|
||||
// }
|
||||
// else {
|
||||
// axiosApiInstance.put(`api/feedback/userCommentUp/${t_userComment.value[0].id}/`, feedObj)
|
||||
// }
|
||||
}
|
||||
|
||||
return {t_baseCriteria, tab_userComment, comment, average, feedAll, feedUp, menusCloses, myLabel, proba}
|
||||
|
||||
Reference in new issue
Block a user