Home > DMT_Folder > modifyFolderDescription
DMT_Folder.modifyFolderDescription() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Modify Folder description
Signature
typescript
function modifyFolderDescription(
teamUuid: string,
folderUuid: string,
description?: string,
): Promise<boolean>;1
2
3
4
5
2
3
4
5
Parameters
Parameter | Type | Description |
|---|---|---|
teamUuid | string | Team UUID |
folderUuid | string | Folder UUID |
description | string | (Optional) Folder description. If it is |
Returns
Promise<boolean>
Whether Modify Successful
Remarks
Modifying the folder description requires interaction with the workspace system. The modification is delayed and takes effect only after a short wait
Example
javascript
// 1. 取当前工程所属团队
const projectInfo = await eda.dmt_Project.getCurrentProjectInfo();
const teamUuid = projectInfo.teamUuid;
// 2. 创建带初始描述的测试文件夹,等 1.5s 让工作区同步
const folderUuid = await eda.dmt_Folder.createFolder('嘉立创示例_改描述', teamUuid, undefined, '嘉立创示例:旧描述');
await new Promise(r => setTimeout(r, 1500));
// 3. 修改文件夹描述
const modified = await eda.dmt_Folder.modifyFolderDescription(teamUuid, folderUuid, '嘉立创示例:更新后的描述');
// 4. 等 1s 让工作区同步,再回读验证
await new Promise(r => setTimeout(r, 1000));
const folderInfo = await eda.dmt_Folder.getFolderInfo(teamUuid, folderUuid);
console.log('modified:', modified);
console.log('description:', folderInfo?.description);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17