feat:更新朋友圈点赞功能
This commit is contained in:
@@ -21,7 +21,15 @@ import {
|
||||
import type { IDialog, IHandleApi, IStatsChart } from 'vue3-common/types'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getCurrentMonth, getCurrentYear, getStartEndDate } from 'vue3-common/utils/dateUtil'
|
||||
import { addCommentApi, addMomentApi, deleteMomentApi, queryMomentApi, updateMomentApi } from '@/apis/moment'
|
||||
import {
|
||||
addCommentApi,
|
||||
addLikeApi,
|
||||
addMomentApi,
|
||||
deleteLikeApi,
|
||||
deleteMomentApi,
|
||||
queryMomentApi,
|
||||
updateMomentApi
|
||||
} from '@/apis/moment'
|
||||
|
||||
export const useFoodStore = defineStore('food', {
|
||||
state: () => ({
|
||||
@@ -193,6 +201,14 @@ export const useFoodStore = defineStore('food', {
|
||||
await addCommentApi(id, content)
|
||||
await this.queryMomentList()
|
||||
},
|
||||
async addLike(id: number) {
|
||||
await addLikeApi(id)
|
||||
await this.queryMomentList()
|
||||
},
|
||||
async deleteLike(id: number) {
|
||||
await deleteLikeApi(id)
|
||||
await this.queryMomentList()
|
||||
},
|
||||
async refreshInfo() {
|
||||
await this.queryRecipeList()
|
||||
await this.queryRecordList()
|
||||
|
||||
Reference in New Issue
Block a user