Files
VRCX/src/api/vrcPlusIcon.js
pa 6bda44be52 refactor: Organize Project Structure (#1211)
* refactor: Organize Project Structure

* fix

* fix

* rm security

* fix
2025-04-18 16:04:03 +10:00

67 lines
1.5 KiB
JavaScript

// #region | App: VRCPlus Icons
const VRCPlusIconsReq = {
getFileList(params) {
return window.API.call('files', {
method: 'GET',
params
}).then((json) => {
const args = {
json,
params
};
window.API.$emit('FILES:LIST', args);
return args;
});
},
deleteFile(fileId) {
return window.API.call(`file/${fileId}`, {
method: 'DELETE'
}).then((json) => {
const args = {
json,
fileId
};
return args;
});
},
uploadVRCPlusIcon(imageData) {
const params = {
tag: 'icon'
};
return window.API.call('file/image', {
uploadImage: true,
matchingDimensions: true,
postData: JSON.stringify(params),
imageData
}).then((json) => {
const args = {
json,
params
};
window.API.$emit('VRCPLUSICON:ADD', args);
return args;
});
}
// unused
// images.pug line 63
// deleteFileVersion(params) {
// return window.API.call(`file/${params.fileId}/${params.version}`, {
// method: 'DELETE'
// }).then((json) => {
// const args = {
// json,
// params
// };
// return args;
// });
// }
};
// #endregion
export default VRCPlusIconsReq;