1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

can add and modify property (#6297)

* can add and modify property

* clear extend property code
This commit is contained in:
JoinTyang
2024-07-05 15:13:26 +08:00
committed by GitHub
parent 182b0f278f
commit 9916ac43e1
29 changed files with 297 additions and 931 deletions

View File

@@ -77,24 +77,35 @@ class MetadataManagerAPI {
return this.req.post(url, data);
}
updateMetadataRecord = (repoID, recordID, creator, createTime, modifier, modifyTime, parentDir, name) => {
addMetadataColumn(repoID, column_name) {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/columns/';
let data = {
'column_name': column_name
};
return this.req.post(url, data);
}
getMetadataRecordInfo(repoID, parentDir, name) {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/record/';
let params = {};
if (parentDir) {
params['parent_dir'] = parentDir;
}
if (name) {
params['name'] = name;
}
return this.req.get(url, {params: params});
}
updateMetadataRecord = (repoID, recordID, columnName, newValue) => {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/records/' + recordID + '/';
const data = {
'creator': creator,
'create_time': createTime,
'modifier': modifier,
'modify_time': modifyTime,
'current_dir': parentDir,
'name': name,
'column_name': columnName,
'value': newValue,
};
return this.req.put(url, data);
};
deleteMetadataRecord = (repoID, recordID) => {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/records/' + recordID + '/';
return this.req.delete(url);
};
listUserInfo = (userIds) => {
const url = this.server + '/api/v2.1/user-list/';
const params = { user_id_list: userIds };