feat:更新朋友圈功能
This commit is contained in:
@@ -21,7 +21,7 @@ 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, queryMomentApi, updateMomentApi } from '@/apis/moment'
|
||||
import { addCommentApi, addMomentApi, deleteMomentApi, queryMomentApi, updateMomentApi } from '@/apis/moment'
|
||||
|
||||
export const useFoodStore = defineStore('food', {
|
||||
state: () => ({
|
||||
@@ -75,7 +75,8 @@ export const useFoodStore = defineStore('food', {
|
||||
recordApiType: 'ADD' as IHandleApi,
|
||||
editRecordIndex: 0,
|
||||
currentMoment: {
|
||||
content: ''
|
||||
content: '',
|
||||
imageList: []
|
||||
} as IMoment,
|
||||
momentApiType: 'ADD' as IHandleApi,
|
||||
imagePath: 'food-hub',
|
||||
@@ -179,7 +180,7 @@ export const useFoodStore = defineStore('food', {
|
||||
ElMessage.success('更新朋友圈成功')
|
||||
break
|
||||
case 'DELETE':
|
||||
// await deleteRecordApi(record.id as number)
|
||||
await deleteMomentApi(moment.id as number)
|
||||
ElMessage.success('删除朋友圈成功')
|
||||
break
|
||||
default:
|
||||
@@ -233,7 +234,8 @@ export const useFoodStore = defineStore('food', {
|
||||
},
|
||||
getEmptyMoment(): IMoment {
|
||||
return {
|
||||
content: ''
|
||||
content: '',
|
||||
imageList: []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user