mirror of
https://gitee.com/dromara/go-view.git
synced 2025-10-14 06:22:10 +08:00
feat: add renameProjectApi
Signed-off-by: harris2012 <harriszhang@live.cn>
This commit is contained in:
parent
edaa9f7b99
commit
5218e854c8
@ -62,6 +62,16 @@ export const updateProjectApi = async (data: object) => {
|
||||
}
|
||||
}
|
||||
|
||||
// * 重命名项目名称
|
||||
export const renameProjectApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.PROJECT}/rename`, data)
|
||||
return res
|
||||
} catch {
|
||||
httpErrorHandle()
|
||||
}
|
||||
}
|
||||
|
||||
// * 删除项目
|
||||
export const deleteProjectApi = async (data: object) => {
|
||||
try {
|
||||
|
@ -32,7 +32,7 @@ import { ResultEnum } from '@/enums/httpEnum'
|
||||
import { fetchRouteParamsLocation, httpErrorHandle, setTitle } from '@/utils'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { ProjectInfoEnum, EditCanvasConfigEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||
import { updateProjectApi } from '@/api/path'
|
||||
import { renameProjectApi } from '@/api/path'
|
||||
import { useSync } from '../../hooks/useSync.hook'
|
||||
import { icon } from '@/plugins'
|
||||
|
||||
@ -68,7 +68,7 @@ const handleFocus = () => {
|
||||
const handleBlur = async () => {
|
||||
focus.value = false
|
||||
chartEditStore.setProjectInfo(ProjectInfoEnum.PROJECT_NAME, title.value || '')
|
||||
const res = (await updateProjectApi({
|
||||
const res = (await renameProjectApi({
|
||||
id: fetchRouteParamsLocation(),
|
||||
projectName: title.value
|
||||
}))
|
||||
|
Loading…
x
Reference in New Issue
Block a user