8. 删除项目的接入

9. 发布与取消发布的接入
master
YunaiV 3 years ago
parent 04bdabe6fe
commit 88fb0854a9
  1. 6
      src/api/path/project.api.ts
  2. 2
      src/views/chart/ContentHeader/headerRightBtn/index.vue
  3. 6
      src/views/project/items/components/ProjectItemsList/hooks/useData.hook.ts

@ -58,7 +58,7 @@ export const updateProjectApi = async (data: object) => {
}
}
// * 删除项目 TODO 芋艿:删除
// * 删除项目
export const deleteProjectApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.DELETE)(`${ModuleTypeEnum.PROJECT}/delete`, data)
@ -68,10 +68,10 @@ export const deleteProjectApi = async (data: object) => {
}
}
// * 修改发布状态 [-1未发布,1发布] TODO 芋艿:更新
// * 修改发布状态 [0 已发布, 1 未发布]
export const changeProjectReleaseApi = async (data: object) => {
try {
const res = await http(RequestHttpEnum.PUT)(`${ModuleTypeEnum.PROJECT}/publish`, data)
const res = await http(RequestHttpEnum.PUT)(`${ModuleTypeEnum.PROJECT}/update`, data)
return res
} catch {
httpErrorHandle()

@ -151,7 +151,7 @@ const sendHandle = async () => {
const res = (await changeProjectReleaseApi({
id: fetchRouteParamsLocation(),
//
state: release.value ? -1 : 1,
status: release.value ? 0 : 1,
}))
if (res && res.code === ResultEnum.SUCCESS) {

@ -71,7 +71,7 @@ export const useDataListInit = () => {
new Promise(res => {
res(
deleteProjectApi({
ids: cardData.id
id: cardData.id
})
)
}),
@ -91,8 +91,8 @@ export const useDataListInit = () => {
const { id, release } = cardData
const res = await changeProjectReleaseApi({
id: id,
// [-1未发布, 1发布]
state: !release ? 1 : -1
// 反过来
status: !release ? 0 : 1
})
if (res && res.code === ResultEnum.SUCCESS) {
list.value = []

Loading…
Cancel
Save